diff --git a/src/cmd/link/internal/ld/ld.go b/src/cmd/link/internal/ld/ld.go index 896e1c87d24..9e5e2f98726 100644 --- a/src/cmd/link/internal/ld/ld.go +++ b/src/cmd/link/internal/ld/ld.go @@ -136,13 +136,13 @@ func findlib(ctxt *Link, lib string) (string, bool) { // try dot, -L "libdir", and then goroot. for _, dir := range ctxt.Libdir { if ctxt.linkShared { - pname = dir + "/" + pkg + ".shlibname" + pname = filepath.Join(dir, pkg+".shlibname") if _, err := os.Stat(pname); err == nil { isshlib = true break } } - pname = dir + "/" + name + pname = filepath.Join(dir, name) if _, err := os.Stat(pname); err == nil { break }