Skip to content

Commit 1764da7

Browse files
callthingsoffcherrymui
authored andcommitted
cmd/link/internal/ld: use strings.TrimPrefix in expandFile
Change-Id: Iea00d1951fa222a6e4e54320d204958dbdeabfe4 GitHub-Last-Rev: f9a1e44 GitHub-Pull-Request: #63874 Reviewed-on: https://go-review.googlesource.com/c/go/+/538863 Reviewed-by: David Chase <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Cherry Mui <[email protected]>
1 parent 642b131 commit 1764da7

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/cmd/link/internal/ld/dwarf.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -1140,9 +1140,7 @@ func (d *dwctxt) importInfoSymbol(dsym loader.Sym) {
11401140
}
11411141

11421142
func expandFile(fname string) string {
1143-
if strings.HasPrefix(fname, src.FileSymPrefix) {
1144-
fname = fname[len(src.FileSymPrefix):]
1145-
}
1143+
fname = strings.TrimPrefix(fname, src.FileSymPrefix)
11461144
return expandGoroot(fname)
11471145
}
11481146

0 commit comments

Comments
 (0)