imported and not used: 。。。 as file ,报 undefined:

之前我的File包是file,我的htmlparts之前是moetemplate
我使用go build后

./router.go:8: imported and not used: "github.com/golangframework/File" as file
./router.go:11: imported and not used: "github.com/golangframework/htmlparts" as moetemplate
./router.go:21: undefined: File in File.ReadAllBytes
./router.go:61: undefined: htmlparts in htmlparts.LoadPartFile
./router.go:62: undefined: File in File.ReadAllText
./router.go:65: undefined: htmlparts in htmlparts.Render

而我的import是这样的

package main

import (
    "encoding/json"
    "log"
    "net/http"

    "github.com/golangframework/File"
    "github.com/golangframework/JSON"
    "github.com/golangframework/Object"
    "github.com/golangframework/htmlparts"
    "github.com/golangframework/httpmongo"
    "github.com/golangframework/moeregexp"
)

另外,我还清理了goroot里的pkg文件夹,更新了src文件夹
请问我的编译到底错在哪了?

阅读 5.7k
1 个回答

哦,sorry,我发现我的goroot的scr文件夹中,moetemplate和file,依然存在,删除后重新从github go get下来,就可以了

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题