下载go和git并安装

  • https://golang.org/dl/
  • https://git-scm.com/downloads

下载gdrive的golang源码:https://github.com/gdrive-org/gdrive/archive/master.zip

编译

SET CGO_ENABLED=0

SET GOOS=linux

SET GOARCH=386

go get github.com/prasmussen/gdrive

go build -ldflags "-w -s"

如果编译64位版本,上面GOARCH改为amd64;如果编译arm版本上面GOARCH改为arm

参考:

https://github.com/gdrive-org/gdrive/issues/426

https://blog.csdn.net/panshiqu/article/details/53788067