Răsfoiți Sursa

FIX: Cross-compile

 Cross-compile your app inside the Docker container
I do that, found it not worked right, then i do this ,it's ok!

fix GOOS GOARCH

fix GOOS GOARCH
formych 6 ani în urmă
părinte
comite
dc0d9fc5d7
1 a modificat fișierele cu 1 adăugiri și 0 ștergeri
  1. 1 0
      golang/content.md

+ 1 - 0
golang/content.md

@@ -59,6 +59,7 @@ Alternatively, you can build for multiple platforms at once:
 $ docker run --rm -it -v "$PWD":/usr/src/myapp -w /usr/src/myapp %%IMAGE%%:1.8 bash
 $ for GOOS in darwin linux; do
 >   for GOARCH in 386 amd64; do
+>     export GOOS GOARCH
 >     go build -v -o myapp-$GOOS-$GOARCH
 >   done
 > done