go run main.go报错
mlb0925 opened this issue · comments
go run main.go
github.com/3xxx/engineercms/models
models/comment.go:12:6: Comment redeclared in this block
models/CommentModel.go:12:6: other declaration of Comment
models/comment.go:39:19: Comment.TableName redeclared in this block
models/CommentModel.go:41:19: other declaration of TableName
models/comment.go:44:19: Comment.TableEngine redeclared in this block
models/CommentModel.go:46:19: other declaration of TableEngine
models/comment.go:48:19: Comment.TableNameWithPrefix redeclared in this block
models/CommentModel.go:50:19: other declaration of TableNameWithPrefix
models/comment.go:52:6: NewComment redeclared in this block
models/CommentModel.go:54:6: other declaration of NewComment
models/comment.go:55:19: Comment.Find redeclared in this block
models/CommentModel.go:179:19: other declaration of Find
models/comment.go:65:19: Comment.Update redeclared in this block
models/CommentModel.go:98:19: other declaration of Update
models/comment.go:74:19: Comment.Insert redeclared in this block
models/CommentModel.go:107:19: other declaration of Insert
models/PayModel.go:40:15: undefined: UserTemple
目前modes里只有commentmodel这个文件,你另外一个comment文件哪里来的?
ubuntu 也报错
# github.com/3xxx/engineercms/models
models/comment.go:12:6: Comment redeclared in this block
models/CommentModel.go:12:6: other declaration of Comment
models/comment.go:39:19: Comment.TableName redeclared in this block
models/CommentModel.go:41:19: other declaration of TableName
models/comment.go:44:19: Comment.TableEngine redeclared in this block
models/CommentModel.go:46:19: other declaration of TableEngine
models/comment.go:48:19: Comment.TableNameWithPrefix redeclared in this block
models/CommentModel.go:50:19: other declaration of TableNameWithPrefix
models/comment.go:52:6: NewComment redeclared in this block
models/CommentModel.go:54:6: other declaration of NewComment
models/comment.go:55:19: Comment.Find redeclared in this block
models/CommentModel.go:179:19: other declaration of Find
models/comment.go:65:19: Comment.Update redeclared in this block
models/CommentModel.go:98:19: other declaration of Update
models/comment.go:74:19: Comment.Insert redeclared in this block
models/CommentModel.go:107:19: other declaration of Insert
models/PayModel.go:40:15: undefined: UserTemple
models/PayModel.go:74:16: undefined: ExcelTemple
models/PayModel.go:74:16: too many errors
另外那个删掉试试。
我的AdminModel.go报错
github.com/3xxx/engineercms/models
models\PassExcelModel.go:42:27: undefined: Select2
models\PassExcelModel.go:43:25: undefined: TextAreal
models\PayModel.go:40:15: undefined: UserTemple
models\AdminModel.go:215:19: undefined: AnsysApdl
models\AdminModel.go:215:33: undefined: AnsysInputs
models\AdminModel.go:215:49: undefined: AnsysOutputs
models\AdminModel.go:215:66: undefined: AnsysHistory
models\AdminModel.go:215:83: undefined: AnsysHistoryInputValue
models\AdminModel.go:215:110: undefined: AnsysHistoryOutputValue
models\AdminModel.go:215:138: undefined: AnsysArticle
models\AdminModel.go:215:138: too many errors
抱歉,我重新更新了一版可以编译通过的,
2023/07/08 13:38:05 ERROR ▶ 0010 Failed to build the application: # github.com/3xxx/engineercms/controllers controllers\chat.go:129:60: too many arguments in call to avatar.New have (string, number) want (string) controllers\project.go:2839:60: too many arguments in call to avatar.New have (string, number) want (string)
遇到这个问题,把下面这段代码,第一行注释,第二行取消注释即可。
// 项目头像
func ProjectAvatar(text, filename string) error {
// 秦修改了源码,支持字的大小,下面第二个参数是字的大小
a := avatar.New("./static/fonts/Hiragino_Sans_GB_W3.ttf", 26.0) //./resource/fonts/Hiragino_Sans_GB_W3.ttf
// a := avatar.New("./static/fonts/Hiragino_Sans_GB_W3.ttf")
go build -ldflags "-w"
//a := avatar.New("./static/fonts/Hiragino_Sans_GB_W3.ttf", 26.0)
//./resource/fonts/Hiragino_Sans_GB_W3.ttf
a := avatar.New("./static/fonts/Hiragino_Sans_GB_W3.ttf")
want (string)
controllers/project.go:2839:60: too many arguments in call to avatar.New
have (string, number)
want (string)
这样解决了 谢谢作者