我收到以下導入代碼的錯誤:代碼:包主import ( "log" "net/http" "os" "github.com/emicklei/go-restful" "github.com/emicklei/go-restful/swagger" "./api")錯誤:.\main.go:9: imported and not used: "_/c_/Users/aaaa/IdeaProjects/app/src/api"鑒于我有package apiapi 文件夾下存儲的文件,是否有導入不起作用的原因?我正在使用下面api在 main.go 中使用func main() { // to see what happens in the package, uncomment the following restful.TraceLogger(log.New(os.Stdout, "[restful] ", log.LstdFlags|log.Lshortfile)) wsContainer := restful.NewContainer() api := ApiResource{map[string]OxiResp{}} api.registerLogin(wsContainer) api.registerAccount(wsContainer) api.registerLostLogin(wsContainer) api.registerWallet(wsContainer)}
導入和未使用錯誤
慕的地6264312
2021-08-16 19:13:35