summaryrefslogtreecommitdiff
path: root/src/time/zoneinfo_read.go
diff options
context:
space:
mode:
authorAgniva De Sarker <agnivade@yahoo.co.in>2018-07-01 01:35:38 +0530
committerIan Lance Taylor <iant@golang.org>2018-09-14 20:51:22 +0000
commit7df585d13d6b85b58045c00460f7c9fed7ecb2ae (patch)
treed05f18acb9464172d6a1c3024adbace39c317524 /src/time/zoneinfo_read.go
parent0e21cc2ba0823f2130d950eccf7c023b161d1331 (diff)
downloadgo-git-7df585d13d6b85b58045c00460f7c9fed7ecb2ae.tar.gz
time: improve error message for LoadLocation
Currently, when a tz file was being checked inside a zoneInfo dir, a syscall.ENOENT error was being returned, which caused it to look in the zoneinfo.zip file and return an error for that case. We return a syscall.ENOENT error for the zip file case too, so that it falls through to the end of the loop and returns an uniform error for both cases. Fixes #20969 Change-Id: If1de068022ac7693caabb5cffd1c929878460140 Reviewed-on: https://go-review.googlesource.com/121877 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/time/zoneinfo_read.go')
-rw-r--r--src/time/zoneinfo_read.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/time/zoneinfo_read.go b/src/time/zoneinfo_read.go
index 29244db29e..15d6aab1de 100644
--- a/src/time/zoneinfo_read.go
+++ b/src/time/zoneinfo_read.go
@@ -364,7 +364,7 @@ func loadTzinfoFromZip(zipfile, name string) ([]byte, error) {
return buf, nil
}
- return nil, errors.New("cannot find " + name + " in zip file " + zipfile)
+ return nil, syscall.ENOENT
}
// loadTzinfoFromTzdata returns the time zone information of the time zone