卓越飞翔博客卓越飞翔博客

卓越飞翔 - 您值得收藏的技术分享站
技术文章35605本站已运行397

创建 vscode Golang 包?

创建 vscode golang 包?

在开发Golang项目时,使用一个强大的编辑器是非常重要的。VSCode是一个广受开发者喜爱的编辑器,它提供了许多功能和插件来提高开发效率。但是,如果你想要在VSCode中创建一个Golang包,可能会遇到一些困惑。不用担心,php小编苹果将为您提供一个简单明了的教程,帮助您轻松创建自己的VSCode Golang包。让我们开始吧!

问题内容

如何从 vscode 中创建新的 go 项目/模块,例如与 go.mod 等?

根据 vscode 设置概述,


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.

在链接的参考文献中搜索发现了多种语言的“新项目”功能,但 go 没有。

解决方法

那是因为 Go 没有脚手架或官方项目模板。 只需创建一个目录,从该目录打开 VS Code,创建一个 go.mod 文件(或运行“Go:初始化 go.mod”vscode 命令),然后创建一个新的 go 文件。就是这样。快乐编码!

卓越飞翔博客
上一篇: 需要验证 go-playground/validator/v10 中的两个字段
下一篇: 返回列表
留言与评论(共有 0 条评论)
   
验证码:
隐藏边栏