mirror of
https://github.com/golang/go
synced 2024-11-17 20:04:47 -07:00
cmd/go/internal: optimize code with newly defined time.DateTime constants
Signed-off-by: cui fliter <imcusg@gmail.com>
This commit is contained in:
parent
2551324cd0
commit
65d3aa9bc2
@ -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)
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user