我有以下目錄結構:github.com meee projectA foo foo.go bar bar.go在 foo.go 中:package fooimport( "github.com/meee/projectA/bar")type Foo struct { Name string Bars []Bar}在 bar.go 中:package bartype Bar struct { Name string}這不會編譯/構建,我得到的錯誤是:undefined: Bar既然我已經導入了,我不知道為什么它不會編譯。
使用自定義結構作為 Go 中另一個結構中的類型而不是構建
慕碼人8056858
2021-09-10 10:59:53