Go語言Beego框架:already exists and is not an object file報錯

Go語言Beego框架:already exists and is not an object file


如果你在使用Beego來進行構建服務組件,那麼在開發過程中如果碰到package 文件夾名卻標記了紅線,錯誤提示爲...already exists and is not an object file的話。

那麼,這個問題是來源於報錯提示中的路徑,去檢查一下吧。

package models
// 報錯,紅線
// 報錯提示 C:\Users\admin\go\pkg\windows_amd64\test\models.a already exists and is not an object file


import (
	...
)
在這裏面,看到我有個models.a文件,但它並不在我的項目文件中的models文件夾下。你的代碼是沒有問題的,只是需要將C:\Users\admin\go\pkg\windows_amd64\test\models.a刪除。

然後bee run -gendoc=true -downdoc=true來重新運行起來。(如果不是BeegoAPI,請使用bee run


// 提示一下,關於go的.a文件
// 它們是已編譯的程序包,這些文件包含已編譯的程序包二進制代碼以及調試符號和源信息。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章