How to CrossCompile Go programs on Windows 10

前端 未结 2 1638
一个人的身影
一个人的身影 2020-12-15 11:21

I want to compile a Go programm for a linux machine. I always used that way which is described here:

How to cross compile from Windows to Linux?

That worked

2条回答
  •  时光说笑
    2020-12-15 12:13

    I faced the same problem

    Install this package

    https://www.npmjs.com/package/cross-env

    and run

    cross-env GOOS=linux go build -o hello
    

提交回复
热议问题