Print interfaces/pointers when -tiny is used (#170)

fixes #167
pull/171/head
Andrew LeFevre 4 years ago committed by GitHub
parent 7ad246c6fe
commit bca460e36e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -121,6 +121,7 @@ func stripRuntime(filename string, file *ast.File) {
if filename == "print.go" {
file.Decls = append(file.Decls, hidePrintDecl)
return
}
// replace all 'print' and 'println' statements in

@ -5,6 +5,7 @@ garble -tiny build
! binsubstr main$exe 'main.go' 'fmt/print.go'
env GODEBUG='allocfreetrace=1,gcpacertrace=1,gctrace=1,scavenge=1,scavtrace=1,scheddetail=1,schedtrace=10'
! exec ./main$exe
stderr '^\(0x[\d\w]{6,8},0x[\d\w]{6,8}\)' # interfaces/pointers print correctly
stderr '^caller: \? 0$' # position info is removed
stderr '^recovered: ya like jazz?'
! stderr 'panic: oh noes' # panics are hidden
@ -27,6 +28,9 @@ package main
import "runtime"
func main() {
var v interface{} = "tada"
println(v)
defer func() {
if r := recover(); r != nil {
println("recovered:", r.(string))

Loading…
Cancel
Save