Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow disabling address of functions #124

Open
flimzy opened this issue May 28, 2020 · 0 comments
Open

Allow disabling address of functions #124

flimzy opened this issue May 28, 2020 · 0 comments

Comments

@flimzy
Copy link
Contributor

flimzy commented May 28, 2020

Structs with function types output the function address, even with DisablePointerAddresses: true. Perhaps that makes sense, since a function type isn't really a pointer. But it would be great to be able to disable these addresses. To reproduce:

package main

import (
	"github.com/davecgh/go-spew/spew"
)

func main() {
	cf := spew.ConfigState{
		DisablePointerAddresses: true,
	}
	x := struct {
		fn func()
	}{
		fn: func() {},
	}
	cf.Dump(x)
}

Which produces the following output:

(struct { fn func() }) {
fn: (func()) 0x4c0020
}

playground

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant