From c5b21c3f4c17b0649155035d2f9aa97b2da8a813 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 30 Jul 2021 14:28:58 -0700 Subject: libgo: update to Go1.17rc2 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/341629 --- libgo/go/embed/embed.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libgo/go/embed/embed.go') 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] -- cgit v1.1