Closed tangyiyong closed 7 months ago
项目根目录下执行 make build-release
错误信息: pkg/misc/misc.go:305:156: cannot use 9999999999 (untyped int constant) as int value in argument to rand.Intn (overflows)
修改: Line305: rand.Intn(9999999999) -> rand.Int63n(9999999999)
另外在mac下make build 编译成功,但是在ubuntu下编译失败,错误信息: ~/aidea-server# make build go build -race -ldflags "-s -w -X main.Version=202401171548 -X main.GitCommit=3a4805df090e055c55703f27bd4d34f802846b62 -X main.DEBUG=true" -o build/debug/aidea-server cmd/main.go build command-line-arguments: cannot load embed: malformed module path "embed": missing dot in first path element make: *** [Makefile:7: build] Error 1
go开发入门新手,不知道这个怎么解决? 谢谢!
这个问题大概率是 Go 版本问题,升级到最新版 (建议 Go 1.21,至少 1.20+)应该就没有这个问题了
项目根目录下执行 make build-release
错误信息: pkg/misc/misc.go:305:156: cannot use 9999999999 (untyped int constant) as int value in argument to rand.Intn (overflows)
修改: Line305: rand.Intn(9999999999) -> rand.Int63n(9999999999)
另外在mac下make build 编译成功,但是在ubuntu下编译失败,错误信息: ~/aidea-server# make build go build -race -ldflags "-s -w -X main.Version=202401171548 -X main.GitCommit=3a4805df090e055c55703f27bd4d34f802846b62 -X main.DEBUG=true" -o build/debug/aidea-server cmd/main.go build command-line-arguments: cannot load embed: malformed module path "embed": missing dot in first path element make: *** [Makefile:7: build] Error 1
go开发入门新手,不知道这个怎么解决? 谢谢!