github.com/pkujhd/goloader@v0.0.0-20240411034752-1a28096bd7bd/obj/pathtoprefix.1.9.go (about)

     1  //go:build go1.9 && !go1.23
     2  // +build go1.9,!go1.23
     3  
     4  package obj
     5  
     6  import "cmd/objfile/objabi"
     7  
     8  func PathToPrefix(s string) string {
     9  	str := objabi.PathToPrefix(s)
    10  	// golang >= 1.18, go.shape is a special builtin package whose name shouldn't be escaped
    11  	if str == "go%2esharp" {
    12  		str = "go.sharp"
    13  	}
    14  	return str
    15  }