Skip to content

A template devcontainer to work with multiple Golang repositories in a devcontainer and VS Code. Requires Golang version >=1.18

License

Notifications You must be signed in to change notification settings

dzungtran/golang-devcontainer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golang devcontainer

A template devcontainer to work with multiple Golang repositories in a devcontainer. For lazy deverlopers who work with multiple GO projects and don't want switch go version on local.

Any feedback and pull requests are welcome and highly appreciated. Feel free to open issues just for comments and discussions.

Requirements

  • Docker (of course)
  • IDE supports devcontainer
  • Minimum GO version: 1.18 - (uses go work feature)

How to use

Click Use this template feature for personal use. And Fork when you want contribute this repo.

  • Clone this repo to your local.
  • Open VSCode with cloned folder.
  • In VS Code: press Cmd + shift + P or Win + shift + P to open Command Palette popup.
  • Search Dev containers: Open Folder in Container, then choose current folder.
  • Waiting to initial container success.
  • Open VSCode terminal, cd to folder src, clone your Golang repos in this.
  • Back to root folder, run command go work use ./src/<your-golang-repo-folder-name>.
  • Enjoy.

Notes

  • Maybe you need add your SSH key to this container for project cloning.
  • You can click Use this template to customize your devcontainer and personal use.
  • In case you're working on private repos: you will need add export GOPRIVATE=github.com/<git-user>/* to ~/.bashrc
  • You can change default GO version of container by: edit file devcontainer.json, default this repo support GO version 1.19.
"image": "mcr.microsoft.com/vscode/devcontainers/go:0-1.19",

About

A template devcontainer to work with multiple Golang repositories in a devcontainer and VS Code. Requires Golang version >=1.18

Topics

Resources

License

Stars

Watchers

Forks