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

FATA Fail to build: fail to generate new go.mod: ... invalid go version '1.22.0': must match format 1.23 #369

Open
ludanfeng opened this issue Mar 15, 2024 · 3 comments

Comments

@ludanfeng
Copy link

goc build --center="http://quanbu-qa.szzhijing.com/goc" --agentport=:9999 --buildflags="-race -ldflags '-X main.Version=72e99d8'" -o ./build/ .
FATA Fail to build: fail to generate new go.mod: /var/folders/ch/bmt18d9j7fl3c24g_t27hmpm0000gn/T/goc-build-7db62eca8474/go.mod:3: invalid go version '1.22.0': must match format 1.23
make: *** [build] Error 1

@lazytooo
Copy link

lazytooo commented Apr 22, 2024

For exmple:
Fail to build: fail to generate new go.mod: /var/folders/ch/bmt18d9j7fl3c24g_t27hmpm0000gn/T/goc-build-7db62eca8474/go.mod

First clone the project, then open /var/folders/ch/bmt18d9j7fl3c24g_t27hmpm0000gn/T/goc-build-7db62eca8474/ copy the project's go.mod to the corresponding path according to the file path, and then query the following code globally: os.RemoveAll(b.TmpDir), comment this line like // os.RemoveAll(b.TmpDir) recompile, find the goc compiled file, and replace it goc in the $GOPATH/bin folder, re-use goc run .

举例:
Fail to build: fail to generate new go.mod: /var/folders/ch/bmt18d9j7fl3c24g_t27hmpm0000gn/T/goc-build-7db62eca8474/go.mod
先克隆项目,然后打开文件夹/var/folders/ch/bmt18d9j7fl3c24g_t27hmpm0000gn/T/goc-build-7db62eca8474/,将项目的go.mod复制到当前路径,然后全局查询下面代码:os.RemoveAll(b.TmpDir),注释这一行,// os.RemoveAll(b.TmpDir),重新编译,找到goc编译文件,替换掉/bin文件夹下的goc,重新使用goc run .

@chenmin032
Copy link

goc build --center="http://quanbu-qa.szzhijing.com/goc" --agentport=:9999 --buildflags="-race -ldflags '-X main.Version=72e99d8'" -o ./build/ . FATA Fail to build: fail to generate new go.mod: /var/folders/ch/bmt18d9j7fl3c24g_t27hmpm0000gn/T/goc-build-7db62eca8474/go.mod:3: invalid go version '1.22.0': must match format 1.23 make: *** [build] Error 1

麻烦问一下,最后面怎么解决的?

@murari-c
Copy link

murari-c commented Nov 7, 2024

did we find a solution for this issue? I am also facing same issue.

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

No branches or pull requests

4 participants