登录
首页 >  Golang >  Go问答

如何在 vscode 中创建 Golang 包?

来源:stackoverflow

时间:2024-02-07 13:09:17 155浏览 收藏

珍惜时间,勤奋学习!今天给大家带来《如何在 vscode 中创建 Golang 包?》,正文内容主要涉及到等等,如果你正在学习Golang,或者是对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 文件。就是这样。快乐编码!

本篇关于《如何在 vscode 中创建 Golang 包?》的介绍就到此结束啦,但是学无止境,想要了解学习更多关于Golang的相关知识,请关注golang学习网公众号!

声明:本文转载于:stackoverflow 如有侵犯,请联系study_golang@163.com删除
相关阅读
更多>
最新阅读
更多>
课程推荐
更多>