Compile go project into linux executable file under windows10

藏色散人
Release: 2020-09-04 13:48:00
forward
3589 people have browsed it

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!

Compile go project into linux executable file under windows10

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
Copy after login

Then compile again and it prompts that I can’t find it. logfmt package:

windows10 编译go项目为linux可执行文件
Global search for this package:
Found that only go.sum memory contains the package information

windows10 编译go项目为linux可执行文件

Attach me The mod:

windows10 编译go项目为linux可执行文件

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!

Related labels:
source:learnku.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!