Skip to content

Commit 4255e2f

Browse files
committed
cmd/go: idx could be equal to zero
1 parent a1e7a41 commit 4255e2f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/cmd/go/internal/bug/bug.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ func printCmdOut(w io.Writer, prefix, path string, args ...string) {
175175
// firstLine returns the first line of a given byte slice.
176176
func firstLine(buf []byte) []byte {
177177
idx := bytes.IndexByte(buf, '\n')
178-
if idx > 0 {
178+
if idx >= 0 {
179179
buf = buf[:idx]
180180
}
181181
return bytes.TrimSpace(buf)

0 commit comments

Comments
 (0)