diff options
author | Ian Lance Taylor <iant@golang.org> | 2021-01-27 17:55:50 -0800 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2021-01-29 11:04:55 -0800 |
commit | 726b7aa004d6885388a76521222602b8552a41ee (patch) | |
tree | 5179037ef840a43dcea0f3be4e07dbcbcfcb2c4a /libgo/go/embed/embed.go | |
parent | 91a95ad2ae0e0f2fa953fafe55ff2ec32c8277d5 (diff) | |
download | gcc-726b7aa004d6885388a76521222602b8552a41ee.zip gcc-726b7aa004d6885388a76521222602b8552a41ee.tar.gz gcc-726b7aa004d6885388a76521222602b8552a41ee.tar.bz2 |
libgo: update to Go1.16rc1
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/287493
Diffstat (limited to 'libgo/go/embed/embed.go')
-rw-r--r-- | libgo/go/embed/embed.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libgo/go/embed/embed.go b/libgo/go/embed/embed.go index 29e0adf..cc6855e 100644 --- a/libgo/go/embed/embed.go +++ b/libgo/go/embed/embed.go @@ -244,6 +244,9 @@ func (f FS) lookup(name string) *file { if name == "." { return dotFile } + if f.files == nil { + return nil + } // Binary search to find where name would be in the list, // and then check if name is at that position. @@ -261,6 +264,9 @@ func (f FS) lookup(name string) *file { // readDir returns the list of files corresponding to the directory dir. func (f FS) readDir(dir string) []file { + if f.files == nil { + return nil + } // Binary search to find where dir starts and ends in the list // and then return that slice of the list. files := *f.files |