gpt4 book ai didi

golang语法错误: unexpected in struct

转载 作者:数据小太阳 更新时间:2023-10-29 03:32:28 24 4
gpt4 key购买 nike

type WebServer struct {
TodoService task.TodoService
UserService usr.UserService
SessionService session.Service
CategoryService task.CategoryService
WorkerService task.WorkerService
ApiWorkerService task.ApiWorkerService
BlacklistService task.BlacklistService
LabelService *labels.Service
StatusService *statuses.Service
InviteService *invites.Service
Runner *task.Runner
TaskForIP make(map[string]int)
Params WebServerParams
}

这是我当前的代码,不是我的应用程序,并返回此错误:

app\infrastructure\web\webserver.go:41:23: syntax error: unexpected (, expecting
semicolon or newline or }

第 41 行是 TaskForIP 行,我无法删除 make,因为它在应用程序中是必需的,我该如何修复?

最佳答案

替换


TaskForIP make(map[string]int)


TaskForIP map[string]int

关于golang语法错误: unexpected in struct,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53585324/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com