Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go run main.go报错 #81

Open
mlb0925 opened this issue Jun 15, 2023 · 7 comments
Open

go run main.go报错 #81

mlb0925 opened this issue Jun 15, 2023 · 7 comments
Labels

Comments

@mlb0925
Copy link

mlb0925 commented Jun 15, 2023

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

@3xxx 3xxx added the bug label Jun 16, 2023
@3xxx
Copy link
Owner

3xxx commented Jun 16, 2023

目前modes里只有commentmodel这个文件,你另外一个comment文件哪里来的?

@3xxx 3xxx added question and removed bug labels Jun 16, 2023
@mlb0925
Copy link
Author

mlb0925 commented Jun 16, 2023

@3xxx mac 系统 不知道那里来的

@mlb0925
Copy link
Author

mlb0925 commented Jun 17, 2023

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

@3xxx
Copy link
Owner

3xxx commented Jun 23, 2023

另外那个删掉试试。

@wuxingshenghua
Copy link

我的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

@3xxx
Copy link
Owner

3xxx commented Jul 8, 2023

抱歉,我重新更新了一版可以编译通过的,
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")

@mlb0925
Copy link
Author

mlb0925 commented Jul 11, 2023

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)
这样解决了 谢谢作者

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants