1+ // For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
2+ // https://github.com/microsoft/vscode-dev-containers/tree/v0.117.1/containers/go
3+ {
4+ "name" : " devcontainer-cli" ,
5+ "dockerFile" : " Dockerfile" ,
6+ "runArgs" : [
7+ // Uncomment the next line to use a non-root user. On Linux, this will prevent
8+ // new files getting created as root, but you may need to update the USER_UID
9+ // and USER_GID in .devcontainer/Dockerfile to match your user if not 1000.
10+ // "-u", "vscode",
11+ " --cap-add=SYS_PTRACE" ,
12+ " --security-opt" ,
13+ " seccomp=unconfined" ,
14+
15+ // Mount go mod cache
16+ " -v" , " devcontainer-cli-gomodcache:/go/pkg" ,
17+ // Keep command history
18+ " -v" , " devcontainer-cli-bashhistory:/root/commandhistory" ,
19+ // Mount docker socket for docker builds
20+ " -v" , " /var/run/docker.sock:/var/run/docker.sock" ,
21+ // Use host network
22+ " --network=host" ,
23+ // Mount azure, git and docker config
24+ " -v" , " ${env:HOME}${env:USERPROFILE}/.azure:/root/.azure"
25+ ],
26+
27+ // Set *default* container specific settings.json values on container create.
28+ "settings" : {
29+ "terminal.integrated.shell.linux" : " /bin/bash" ,
30+ "go.gopath" : " /go" ,
31+ "go.useLanguageServer" : true ,
32+ "[go]" : {
33+ "editor.snippetSuggestions" : " none" ,
34+ "editor.formatOnSave" : true ,
35+ "editor.codeActionsOnSave" : {
36+ "source.organizeImports" : true ,
37+ }
38+ },
39+ "gopls" : {
40+ "usePlaceholders" : true , // add parameter placeholders when completing a function
41+ // Experimental settings
42+ "completeUnimported" : true , // autocomplete unimported packages
43+ "watchFileChanges" : true , // watch file changes outside of the editor
44+ "deepCompletion" : true , // enable deep completion
45+ },
46+ "files.eol" : " \n " , // formatting only supports LF line endings
47+ },
48+
49+ // Add the IDs of extensions you want installed when the container is created.
50+ "extensions" : [
51+ " ms-vscode.go"
52+ ]
53+
54+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
55+ // "forwardPorts": [],
56+
57+ // Use 'postCreateCommand' to run commands after the container is created.
58+ // "postCreateCommand": "go version",
59+
60+ // Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
61+ // "remoteUser": "vscode"
62+ }
0 commit comments