github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/internal/pkgpath/pkgpath.go (about) 1 // Copyright 2020 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // Package pkgpath determines the package path used by gccgo/GoLLVM symbols. 6 // This package is not used for the gc compiler. 7 package pkgpath 8 9 // ToSymbolFunc returns a function that may be used to convert a 10 // package path into a string suitable for use as a symbol. 11 // cmd is the gccgo/GoLLVM compiler in use, and tmpdir is a temporary 12 // directory to pass to os.CreateTemp(). 13 // For example, this returns a function that converts "net/http" 14 // into a string like "net..z2fhttp". The actual string varies for 15 // different gccgo/GoLLVM versions, which is why this returns a function 16 // that does the conversion appropriate for the compiler in use. 17 func ToSymbolFunc(cmd, tmpdir string) (func(string) string, error)