首頁  >  文章  >  後端開發  >  創建 vscode Golang 包?

創建 vscode Golang 包?

王林
王林轉載
2024-02-13 21:39:08543瀏覽

创建 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 檔案。就是這樣。快樂編碼!

以上是創建 vscode Golang 包?的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:stackoverflow.com。如有侵權,請聯絡admin@php.cn刪除