Skip to content

Commit db863c7

Browse files
marclopvdemeester
authored andcommitted
Update example #261
Signed-off-by: MarcLopez <[email protected]> Signed-off-by: Vincent Demeester <[email protected]>
1 parent f4f90be commit db863c7

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
*.swp
77
bundles
88
.gopath
9+
.idea

Diff for: README.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ package main
1313
import (
1414
"log"
1515

16+
"golang.org/x/net/context"
17+
1618
"github.com/docker/libcompose/docker"
1719
"github.com/docker/libcompose/project"
20+
"github.com/docker/libcompose/project/options"
1821
)
1922

2023
func main() {
@@ -23,13 +26,17 @@ func main() {
2326
ComposeFiles: []string{"docker-compose.yml"},
2427
ProjectName: "my-compose",
2528
},
26-
})
29+
}, nil)
2730

2831
if err != nil {
2932
log.Fatal(err)
3033
}
3134

32-
project.Up()
35+
err = project.Up(context.Background(), options.Up{})
36+
37+
if err != nil {
38+
log.Fatal(err)
39+
}
3340
}
3441
```
3542

Diff for: example/main.go

+9-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ package main
33
import (
44
"log"
55

6+
"golang.org/x/net/context"
7+
68
"github.com/docker/libcompose/docker"
79
"github.com/docker/libcompose/project"
10+
"github.com/docker/libcompose/project/options"
811
)
912

1013
func main() {
@@ -13,11 +16,15 @@ func main() {
1316
ComposeFiles: []string{"docker-compose.yml"},
1417
ProjectName: "yeah-compose",
1518
},
16-
})
19+
}, nil)
1720

1821
if err != nil {
1922
log.Fatal(err)
2023
}
2124

22-
project.Up()
25+
err = project.Up(context.Background(), options.Up{})
26+
27+
if err != nil {
28+
log.Fatal(err)
29+
}
2330
}

0 commit comments

Comments
 (0)