Home > Article > Backend Development > Compile go project into linux executable file under windows10
The following column will introduce to you how to compile go projects into Linux executable files under Windows 10 from the golang tutorial column. I hope it will be helpful to friends in need!
I compiled an exe executable file in advance, no problem
Set the linux compilation configuration:
SET GOOS=linux SET GOARCH=amd64 SET CGO_ENABLED=0
Then compile again and it prompts that I can’t find it. logfmt package:
Global search for this package:
Found that only go.sum memory contains the package information
Attach me The mod:
I'm not sure if there's a package that depends on it that's causing my problem, but I was able to compile it before and couldn't compile after reconfiguring it
Now when I set: SET GOOS=windows, it is invalid. It cannot be compiled.
prompts that the package path cannot be found, and after I go get it, it has no effect.
The above is the detailed content of Compile go project into linux executable file under windows10. For more information, please follow other related articles on the PHP Chinese website!