Skip to content

Commit 66b00d7

Browse files
committed
use bytes.IndexByte
Signed-off-by: Grant Linville <[email protected]>
1 parent b55897a commit 66b00d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/builtin/builtin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ func SysRead(_ context.Context, _ []string, input string, _ chan<- string) (stri
491491
}
492492

493493
// Assume the file is not text if it contains a null byte
494-
if bytes.Contains(data, []byte{0}) {
494+
if bytes.IndexByte(data, 0) != -1 {
495495
return fmt.Sprintf("The file %s cannot be read because it is not a plaintext file", params.Filename), nil
496496
}
497497

0 commit comments

Comments
 (0)