gopls modernize

This commit is contained in:
Caleb Gardner
2025-02-27 02:46:22 -06:00
parent e9fdd89c67
commit 87b5ac7f5d
9 changed files with 25 additions and 33 deletions
+1 -4
View File
@@ -73,10 +73,7 @@ func (r *Reader) Read(b []byte) (int, error) {
return curRead, err
}
}
toRead = len(b) - curRead
if toRead > len(r.dat)-r.curOffset {
toRead = len(r.dat) - r.curOffset
}
toRead = min(len(b)-curRead, len(r.dat)-r.curOffset)
toRead = copy(b[curRead:], r.dat[r.curOffset:r.curOffset+toRead])
r.curOffset += toRead
curRead += toRead