aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/debug/mod.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2024-10-22 17:24:56 -0700
committerGopher Robot <gobot@golang.org>2024-10-23 04:48:55 +0000
commitd0631b90a3b0934d0fe223e2d889d785d297f083 (patch)
treeb8aec1636d3c5a616dbb7fbfac3a27f43124455b /src/runtime/debug/mod.go
parent0c460ad0142b6ca1866272002f90fb8166ce4cc0 (diff)
downloadgo-d0631b90a3b0934d0fe223e2d889d785d297f083.tar.xz
runtime/debug: minor cleanups after CL 384154
Change some vars to consts, remove some unneeded string conversions. Change-Id: Ib12eed11ef080c4b593c8369bb915117e7100045 Reviewed-on: https://go-review.googlesource.com/c/go/+/621838 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Diffstat (limited to 'src/runtime/debug/mod.go')
-rw-r--r--src/runtime/debug/mod.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/runtime/debug/mod.go b/src/runtime/debug/mod.go
index 8a1b1666bd..53bbf1d847 100644
--- a/src/runtime/debug/mod.go
+++ b/src/runtime/debug/mod.go
@@ -161,7 +161,7 @@ func ParseBuildInfo(data string) (bi *BuildInfo, err error) {
}
}()
- var (
+ const (
pathLine = "path\t"
modLine = "mod\t"
depLine = "dep\t"
@@ -202,7 +202,7 @@ func ParseBuildInfo(data string) (bi *BuildInfo, err error) {
switch {
case strings.HasPrefix(line, pathLine):
elem := line[len(pathLine):]
- bi.Path = string(elem)
+ bi.Path = elem
case strings.HasPrefix(line, modLine):
elem := strings.Split(line[len(modLine):], tab)
last = &bi.Main
@@ -227,9 +227,9 @@ func ParseBuildInfo(data string) (bi *BuildInfo, err error) {
return nil, fmt.Errorf("replacement with no module on previous line")
}
last.Replace = &Module{
- Path: string(elem[0]),
- Version: string(elem[1]),
- Sum: string(elem[2]),
+ Path: elem[0],
+ Version: elem[1],
+ Sum: elem[2],
}
last = nil
case strings.HasPrefix(line, buildLine):