@ -56,12 +56,17 @@ package main
import (
import (
"os"
"os"
"runtime"
"test/main/lib"
"test/main/lib"
)
)
func main() {
func main() {
unexportedMainFunc()
unexportedMainFunc()
_, filename, _, _ := runtime.Caller(0)
println()
println("main filename:", filename)
}
}
func unexportedMainFunc() {
func unexportedMainFunc() {
@ -79,12 +84,17 @@ package lib
import (
import (
"io"
"io"
"regexp"
"regexp"
"runtime"
"runtime/debug"
"runtime/debug"
)
)
type ExportedLibType struct{}
type ExportedLibType struct{}
func (*ExportedLibType) ExportedLibMethod(w io.Writer) error {
func (*ExportedLibType) ExportedLibMethod(w io.Writer) error {
_, filename, _, _ := runtime.Caller(0)
println("lib filename:", filename)
println()
return printStackTrace(w)
return printStackTrace(w)
}
}
@ -121,19 +131,23 @@ var _ = reflect.TypeOf(UnobfuscatedStruct{})
var _ = struct{SomeField int}(UnobfuscatedStruct{})
var _ = struct{SomeField int}(UnobfuscatedStruct{})
-- reverse.stdout --
-- reverse.stdout --
lib filename: test/main/lib/lib.go
goroutine 1 [running]:
goroutine 1 [running]:
runtime/debug.Stack(0x??, 0x??, 0x??)
runtime/debug.Stack(0x??, 0x??, 0x??)
runtime/debug/stack.go:24 +0x??
runtime/debug/stack.go:24 +0x??
test/main/lib.printStackTrace(0x??, 0x??, 0x??, 0x??)
test/main/lib.printStackTrace(0x??, 0x??, 0x??, 0x??)
test/main/lib/lib.go:23 +0x??
test/main/lib/lib.go:28 +0x??
test/main/lib.(*ExportedLibType).ExportedLibMethod(... )
test/main/lib.(*ExportedLibType).ExportedLibMethod(0x??, 0x??, 0x??, 0x??, 0x?? )
test/main/lib/lib.go:12
test/main/lib/lib.go:17 +0x??
main.unexportedMainFunc.func1()
main.unexportedMainFunc.func1(... )
test/main/main.go:16 +0x??
test/main/main.go:2 1
main.unexportedMainFunc()
main.unexportedMainFunc()
test/main/main.go:20 +0x??
test/main/main.go:25 +0x??
main.main()
main.main()
test/main/main.go:10 +0x??
test/main/main.go:11 +0x??
main filename: test/main/main.go
-- build-error-reverse.stdout --
-- build-error-reverse.stdout --
# test/main/build-error
# test/main/build-error
test/main/build-error/error.go:18: cannot convert UnobfuscatedStruct{} (type UnobfuscatedStruct) to type struct { SomeField int }
test/main/build-error/error.go:18: cannot convert UnobfuscatedStruct{} (type UnobfuscatedStruct) to type struct { SomeField int }