gomods / athens

A Go module datastore and proxy
https://docs.gomods.io
MIT License
4.38k stars 492 forks source link

build-from-source document issue #1621

Open kzhui125 opened 4 years ago

kzhui125 commented 4 years ago

From the document, https://docs.gomods.io/install/build-from-source/

git clone https://github.com/gomods/athens
cd athens
$env:GO111MODULE="on"
$env:GOPROXY="https://proxy.golang.org"
$version = "0.2.0"
$date = (Get-Date).ToUniversalTime()
go build -ldflags "-X github.com/gomods/athens/pkg/build.version=$version -X github.com/gomods/athens/pkg/build.buildDate=$date" -o athens ./cmd/proxy

I am using Windows Chinese version, and (Get-Date).ToUniversalTime() will get something like "2020年5月26日 8:50:26", which has space, so go build will fail.

If I change the $date to "20200526", go build success

ljluestc commented 1 year ago
git clone https://github.com/gomods/athens
cd athens
$env:GO111MODULE="on"
$env:GOPROXY="https://proxy.golang.org"
$version = "0.2.0"
$date = "20200526"
go build -ldflags "-X github.com/gomods/athens/pkg/build.version=$version -X github.com/gomods/athens/pkg/build.buildDate=$date" -o athens ./cmd/proxy