diff options
author | Niall Sheridan <nsheridan@gmail.com> | 2016-10-31 16:36:17 +0000 |
---|---|---|
committer | Niall Sheridan <nsheridan@gmail.com> | 2016-10-31 16:40:08 +0000 |
commit | e0a1ccb64a637673195804513902cba6b1d4e97c (patch) | |
tree | abc1598be28cda231d92cda8fb10b49eeb564c29 /vendor/golang.org/x/text/internal | |
parent | 7bad329d417f19ba4aae2b4607281c2bc5df8ad7 (diff) |
Update dependencies
Diffstat (limited to 'vendor/golang.org/x/text/internal')
-rw-r--r-- | vendor/golang.org/x/text/internal/gen/gen.go | 17 | ||||
-rw-r--r-- | vendor/golang.org/x/text/internal/ucd/ucd.go | 2 |
2 files changed, 12 insertions, 7 deletions
diff --git a/vendor/golang.org/x/text/internal/gen/gen.go b/vendor/golang.org/x/text/internal/gen/gen.go index 9eb2987..84c699f 100644 --- a/vendor/golang.org/x/text/internal/gen/gen.go +++ b/vendor/golang.org/x/text/internal/gen/gen.go @@ -85,7 +85,11 @@ func CLDRVersion() string { // IsLocal reports whether data files are available locally. func IsLocal() bool { - if _, err := os.Stat(localReadmeFile()); err != nil { + dir, err := localReadmeFile() + if err != nil { + return false + } + if _, err = os.Stat(dir); err != nil { return false } return true @@ -130,19 +134,22 @@ var ( const permissions = 0755 -func localReadmeFile() string { +func localReadmeFile() (string, error) { p, err := build.Import("golang.org/x/text", "", build.FindOnly) if err != nil { - log.Fatalf("Could not locate package: %v", err) + return "", fmt.Errorf("Could not locate package: %v", err) } - return filepath.Join(p.Dir, "DATA", "README") + return filepath.Join(p.Dir, "DATA", "README"), nil } func getLocalDir() string { dirMutex.Lock() defer dirMutex.Unlock() - readme := localReadmeFile() + readme, err := localReadmeFile() + if err != nil { + log.Fatal(err) + } dir := filepath.Dir(readme) if _, err := os.Stat(readme); err != nil { if err := os.MkdirAll(dir, permissions); err != nil { diff --git a/vendor/golang.org/x/text/internal/ucd/ucd.go b/vendor/golang.org/x/text/internal/ucd/ucd.go index 60b27d5..309e8d8 100644 --- a/vendor/golang.org/x/text/internal/ucd/ucd.go +++ b/vendor/golang.org/x/text/internal/ucd/ucd.go @@ -13,7 +13,6 @@ import ( "bufio" "bytes" "errors" - "fmt" "io" "log" "regexp" @@ -112,7 +111,6 @@ func (p *Parser) setError(err error) { func (p *Parser) getField(i int) []byte { if i >= len(p.field) { - p.setError(fmt.Errorf("ucd: index of field %d out of bounds", i)) return nil } return p.field[i] |