diff options
author | Ian Lance Taylor <iant@golang.org> | 2021-07-30 14:28:58 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2021-08-12 20:23:07 -0700 |
commit | c5b21c3f4c17b0649155035d2f9aa97b2da8a813 (patch) | |
tree | c6d3a68b503ba5b16182acbb958e3e5dbc95a43b /libgo/go/embed/embed.go | |
parent | 72be20e20299ec57b4bc9ba03d5b7d6bf10e97cc (diff) | |
download | gcc-c5b21c3f4c17b0649155035d2f9aa97b2da8a813.zip gcc-c5b21c3f4c17b0649155035d2f9aa97b2da8a813.tar.gz gcc-c5b21c3f4c17b0649155035d2f9aa97b2da8a813.tar.bz2 |
libgo: update to Go1.17rc2
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/341629
Diffstat (limited to 'libgo/go/embed/embed.go')
-rw-r--r-- | libgo/go/embed/embed.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libgo/go/embed/embed.go b/libgo/go/embed/embed.go index 98da870..851cc21 100644 --- a/libgo/go/embed/embed.go +++ b/libgo/go/embed/embed.go @@ -143,7 +143,7 @@ import ( // See the package documentation for more details about initializing an FS. type FS struct { // The compiler knows the layout of this struct. - // See cmd/compile/internal/gc's initEmbed. + // See cmd/compile/internal/staticdata's WriteEmbed. // // The files list is sorted by name but not by simple string comparison. // Instead, each file's name takes the form "dir/elem" or "dir/elem/". @@ -213,7 +213,7 @@ var ( // It implements fs.FileInfo and fs.DirEntry. type file struct { // The compiler knows the layout of this struct. - // See cmd/compile/internal/gc's initEmbed. + // See cmd/compile/internal/staticdata's WriteEmbed. name string data string hash [16]byte // truncated SHA256 hash @@ -386,15 +386,15 @@ func (d *openDir) Read([]byte) (int, error) { func (d *openDir) ReadDir(count int) ([]fs.DirEntry, error) { n := len(d.files) - d.offset - if count > 0 && n > count { - n = count - } if n == 0 { if count <= 0 { return nil, nil } return nil, io.EOF } + if count > 0 && n > count { + n = count + } list := make([]fs.DirEntry, n) for i := range list { list[i] = &d.files[d.offset+i] |