Home > Software design >  Create a vscode Golang package?
Create a vscode Golang package?

Time:12-29

How do I create a new Go project/module from within vscode, e.g. with a go.mod, etc.?

According to the vscode Setup Overview,

How do I create and run a new project?

VS Code doesn't include a traditional File > New Project dialog or pre-installed project templates. You'll need to add additional components and scaffolders depending on your development interests. With scaffolding tools like Yeoman and the multitude of modules available through the npm package manager, you're sure to find appropriate templates and tools to create your projects.

Searching at the linked references revealed "new project" functionality for several languages but not for Go.

CodePudding user response:

That's because there are no scaffolding or official project templates for Go. Just create a directory, open vs code from the directory, create a go.mod file (or run "Go: Initialize go.mod" vscode command), and create a new go file. That's it. Happy coding!

  • Related