aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcui fliter <imcusg@gmail.com>2022-09-23 21:29:44 +0000
committerGopher Robot <gobot@golang.org>2022-09-27 12:49:31 +0000
commitf6e1677428e3df28e936cb000b58fca377f67d72 (patch)
tree15bec6ce17f856031918afc2948f175a365c1a97 /src
parente6d9057e2f3442b133afe7e37bec72bb9b780b04 (diff)
downloadgo-f6e1677428e3df28e936cb000b58fca377f67d72.tar.xz
cmd/go/internal: use time.DateTime constant
Use the newly defined time.Datetime constant instead of a string literal. Updates #52746 Change-Id: I2722415ecc67fd2adfdab2eaba3298774032bff3 GitHub-Last-Rev: 65d3aa9bc229cf6d07d6d0c1aaee4ada9056cd49 GitHub-Pull-Request: golang/go#55833 Reviewed-on: https://go-review.googlesource.com/c/go/+/433277 Run-TryBot: Joseph Tsai <joetsai@digital-static.net> Auto-Submit: Joseph Tsai <joetsai@digital-static.net> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Joseph Tsai <joetsai@digital-static.net> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Bryan Mills <bcmills@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/go/internal/modfetch/codehost/vcs.go2
-rw-r--r--src/cmd/go/internal/vcs/vcs.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/go/internal/modfetch/codehost/vcs.go b/src/cmd/go/internal/modfetch/codehost/vcs.go
index 4d0e863182..99be8646a4 100644
--- a/src/cmd/go/internal/modfetch/codehost/vcs.go
+++ b/src/cmd/go/internal/modfetch/codehost/vcs.go
@@ -587,7 +587,7 @@ func fossilParseStat(rev, out string) (*RevInfo, error) {
if len(f) != 5 || len(f[1]) != 40 || f[4] != "UTC" {
return nil, vcsErrorf("unexpected response from fossil info: %q", line)
}
- t, err := time.Parse("2006-01-02 15:04:05", f[2]+" "+f[3])
+ t, err := time.Parse(time.DateTime, f[2]+" "+f[3])
if err != nil {
return nil, vcsErrorf("unexpected response from fossil info: %q", line)
}
diff --git a/src/cmd/go/internal/vcs/vcs.go b/src/cmd/go/internal/vcs/vcs.go
index 9ea8eb2bad..baa0876742 100644
--- a/src/cmd/go/internal/vcs/vcs.go
+++ b/src/cmd/go/internal/vcs/vcs.go
@@ -561,7 +561,7 @@ func fossilStatus(vcsFossil *Cmd, rootDir string) (Status, error) {
}
rev := checkout[:i]
- commitTime, err := time.ParseInLocation("2006-01-02 15:04:05", checkout[i+1:], time.UTC)
+ commitTime, err := time.ParseInLocation(time.DateTime, checkout[i+1:], time.UTC)
if err != nil {
return Status{}, fmt.Errorf("%v: %v", errFossilInfo, err)
}