老師,為什么 下面這段代碼
package main
import "net/http"
func main(){
http.ListenAndServe(":8080",nil)
}
main函數(shù)編輯器會(huì)報(bào)錯(cuò) 'main' redeclared in this package 這個(gè)呢?當(dāng)前目錄下只有一個(gè)main.go文件呢?環(huán)境是go1.18
![]() |
cxj123520
展開(kāi)
老師,為什么 下面這段代碼
package main
import "net/http"
func main(){
http.ListenAndServe(":8080",nil)
}
main函數(shù)編輯器會(huì)報(bào)錯(cuò) 'main' redeclared in this package 這個(gè)呢?當(dāng)前目錄下只有一個(gè)main.go文件呢?環(huán)境是go1.18 |
承擔(dān)因您的行為而導(dǎo)致的法律責(zé)任,
本站有權(quán)保留或刪除有爭(zhēng)議評(píng)論。
參與本評(píng)論即表明您已經(jīng)閱讀并接受
上述條款。