Skip to content

Commit 3a223f7

Browse files
committed
SDK: fix some minor issues in go examples
Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent c7c1a59 commit 3a223f7

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

Diff for: engine/api/sdk/examples.md

+13-12
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ redirect_from:
1111

1212
After you
1313
[install Docker](/install/index.md), you can
14-
[install the Go and Python SDKs](/develop/sdk/index.md#install-the-sdks) and
14+
[install the Go or Python SDK](/engine/api/sdk/index.md#install-the-sdks) and
1515
also try out the Docker Engine API.
1616

1717
Each of these examples show how to perform a given Docker operation using the Go
@@ -40,13 +40,14 @@ command prompt:
4040
package main
4141

4242
import (
43-
"os"
43+
"context"
4444
"io"
45+
"os"
46+
4547
"github.com/docker/docker/api/types"
4648
"github.com/docker/docker/api/types/container"
47-
"github.com/docker/docker/pkg/stdcopy"
4849
"github.com/docker/docker/client"
49-
"golang.org/x/net/context"
50+
"github.com/docker/docker/pkg/stdcopy"
5051
)
5152

5253
func main() {
@@ -144,14 +145,14 @@ You can also run containers in the background, the equivalent of typing
144145
package main
145146

146147
import (
148+
"context"
147149
"fmt"
148150
"io"
149151
"os"
150152

151153
"github.com/docker/docker/api/types"
152154
"github.com/docker/docker/api/types/container"
153155
"github.com/docker/docker/client"
154-
"golang.org/x/net/context"
155156
)
156157

157158
func main() {
@@ -230,11 +231,11 @@ You can use the API to list containers that are running, just like using
230231
package main
231232

232233
import (
234+
"context"
233235
"fmt"
234236

235237
"github.com/docker/docker/api/types"
236238
"github.com/docker/docker/client"
237-
"golang.org/x/net/context"
238239
)
239240

240241
func main() {
@@ -306,11 +307,11 @@ This example stops all running containers.
306307
package main
307308

308309
import (
310+
"context"
309311
"fmt"
310312

311313
"github.com/docker/docker/api/types"
312314
"github.com/docker/docker/client"
313-
"golang.org/x/net/context"
314315
)
315316

316317
func main() {
@@ -386,12 +387,12 @@ to change the hard-coded ID of the container to print the logs for.
386387
package main
387388

388389
import (
390+
"context"
389391
"io"
390392
"os"
391393

392394
"github.com/docker/docker/api/types"
393395
"github.com/docker/docker/client"
394-
"golang.org/x/net/context"
395396
)
396397

397398
func main() {
@@ -456,11 +457,11 @@ List the images on your Engine, similar to `docker image ls`:
456457
package main
457458

458459
import (
460+
"context"
459461
"fmt"
460462

461463
"github.com/docker/docker/api/types"
462464
"github.com/docker/docker/client"
463-
"golang.org/x/net/context"
464465
)
465466

466467
func main() {
@@ -526,12 +527,12 @@ Pull an image, like `docker pull`:
526527
package main
527528

528529
import (
530+
"context"
529531
"io"
530532
"os"
531533

532534
"github.com/docker/docker/api/types"
533535
"github.com/docker/docker/client"
534-
"golang.org/x/net/context"
535536
)
536537

537538
func main() {
@@ -600,14 +601,14 @@ Pull an image, like `docker pull`, with authentication:
600601
package main
601602

602603
import (
604+
"context"
603605
"encoding/base64"
604606
"encoding/json"
605607
"io"
606608
"os"
607609

608610
"github.com/docker/docker/api/types"
609611
"github.com/docker/docker/client"
610-
"golang.org/x/net/context"
611612
)
612613

613614
func main() {
@@ -699,12 +700,12 @@ Commit a container to create an image from its contents:
699700
package main
700701

701702
import (
703+
"context"
702704
"fmt"
703705

704706
"github.com/docker/docker/api/types"
705707
"github.com/docker/docker/api/types/container"
706708
"github.com/docker/docker/client"
707-
"golang.org/x/net/context"
708709
)
709710

710711
func main() {

0 commit comments

Comments
 (0)