草庐IT

go - 在 Go 中导入自定义包

我checkedoutthisanswer出于某种原因,要么我无法正确理解,要么它不起作用此外,在我开始之前,我知道我们如何使用github来做,但我想在没有github的情况下尝试首先假设我有一个main.go文件packagemainimport("fmt""math""subpack")//YouImportpackageswithoutusingcommainGo,ratherspaceornewline//InVSCode,ifyouusearen'tusingthepackageandrunthenitwillautomaticallyremovieitfuncmain()

go - 在 Go 中导入自定义包

我checkedoutthisanswer出于某种原因,要么我无法正确理解,要么它不起作用此外,在我开始之前,我知道我们如何使用github来做,但我想在没有github的情况下尝试首先假设我有一个main.go文件packagemainimport("fmt""math""subpack")//YouImportpackageswithoutusingcommainGo,ratherspaceornewline//InVSCode,ifyouusearen'tusingthepackageandrunthenitwillautomaticallyremovieitfuncmain()