Skip to content

Commit

Permalink
Use GetFuncValueSourceAsString on reflect value directly.
Browse files Browse the repository at this point in the history
This avoids the need for bypass.
  • Loading branch information
dmitshur committed Nov 15, 2014
1 parent 16dd4ea commit 46f8e2d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import (
// TODO: Replace with "go/format" once Go 1.4 is released.
format5551fixed "github.com/shurcooL/go/go/format"

"github.com/shurcooL/go-goon/bypass"

"os/exec"

"path/filepath"
Expand Down Expand Up @@ -299,10 +297,7 @@ func (d *dumpState) dump(v reflect.Value) {
printHexPtr(d.w, uintptr(v.Uint()))

case reflect.Func:
if !v.CanInterface() {
v = bypass.UnsafeReflectValue(v)
}
d.w.Write([]byte(GetSourceAsString(v.Interface())))
d.w.Write([]byte(GetFuncValueSourceAsString(v)))

case reflect.UnsafePointer, reflect.Chan:
printHexPtr(d.w, v.Pointer())
Expand Down

0 comments on commit 46f8e2d

Please sign in to comment.