Created
January 5, 2014 20:17
-
-
Save joshlf/8273261 to your computer and use it in GitHub Desktop.
"go build" can be passed linker flags. If the "-s" flag is passed to remove debugging information, runtime reflection can break. Try building with 'go build' and with 'go build -ldflags "-s"' separately.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"reflect" | |
"runtime" | |
) | |
func main() { | |
fmt.Println(runtime.FuncForPC(reflect.ValueOf(main).Pointer()).Name()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note: I ran this test on go1.0.2