亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

導入但未使用:as,未定義

導入但未使用:as,未定義

Go
慕虎7371278 2021-12-07 14:48:28
我將文件重命名為文件,并將 moetemplate 重命名為 htmlparts 然后去構建./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我的進口是這個package mainimport (    "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 為什么構建錯誤?
查看完整描述

2 回答

?
浮云間

TA貢獻1829條經驗 獲得超4個贊

需要注意的大小寫不同file和File。既然你談論重命名文件,我假設你的代碼真的很像


package main


import (

    file "github.com/golangframework/File"

)


func main() {

    File.ReadAllBytes("foo")

}

要么不重命名File模塊(除去file在進口),或稱其為file替代File。


查看完整回答
反對 回復 2021-12-07
?
紫衣仙女

TA貢獻1839條經驗 獲得超15個贊

哦,,,對不起,我檢查了 goroot scr,發現舊的 moetemplate.go 和 file.go 仍然存在

所以我刪除了那些,然后從 github 獲取,而不是好的


查看完整回答
反對 回復 2021-12-07
  • 2 回答
  • 0 關注
  • 174 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號