Skip to content

goleak.IgnoreAnyFunction not working for rollbar-go #118

Answered by abhinav
sagarrohankar-bsft asked this question in Q&A
Discussion options

You must be logged in to vote

Hey, @sagarrohankar-bsft, IgnoreAnyFunction is an option. You have to pass it to VerifyTestMain.
Like so:

goleak.VerifyTestMain(m,
  goleak.IgnoreAnyFunction("github.com/rollbar/rollbar-go.NewAsyncTransport.func1"),
  goleak.IgnoreAnyFunction("github.com/rollbar/rollbar-go.NewAsyncTransport"),
)

Also, note that goleak.VerifyTestMain will call m.Run() for you, so it will never reach the os.Exit(testMain(m)) you've added there.

Hope this helps!

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sagarrohankar-bsft
Comment options

Answer selected by sagarrohankar-bsft
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #117 on November 24, 2023 22:01.