diff options
Diffstat (limited to 'src/runtime/debug')
| -rw-r--r-- | src/runtime/debug/mod.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/runtime/debug/mod.go b/src/runtime/debug/mod.go index 0381bdcc53..05cad61155 100644 --- a/src/runtime/debug/mod.go +++ b/src/runtime/debug/mod.go @@ -70,11 +70,10 @@ func readBuildInfo(data string) (*BuildInfo, bool) { ) // Reverse of cmd/go/internal/modload.PackageBuildInfo for len(data) > 0 { - i := strings.IndexByte(data, '\n') - if i < 0 { + line, data, ok = strings.Cut(data, "\n") + if !ok { break } - line, data = data[:i], data[i+1:] switch { case strings.HasPrefix(line, pathLine): elem := line[len(pathLine):] |
