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

add build tag to disable tracing #754

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rashmi-tondare
Copy link

This PR addresses issue #704

Changes

Add a build tag retrynotrace to disable tracing to help with dead code elimination

Verification

Wrote a small main function and built it with & without the build tag to get the expected output.

  • Without the build tag:
✗ go build -ldflags=-dumpdep ./interceptors/retry/main |& whydeadcode
text/template.(*state).evalField reachable from:
         text/template.(*state).evalFieldChain
         text/template.(*state).evalCommand
         text/template.(*state).evalPipeline
         text/template.(*state).walk
         text/template.(*Template).execute
         html/template.(*Template).Execute
         golang.org/x/net/trace.RenderEvents
         golang.org/x/net/trace.Events
         golang.org/x/net/trace.Events·f
         golang.org/x/net/trace.init.0
         golang.org/x/net/trace..inittask
         go:main.inittasks
         _
  • With the build tag (no output):
    ✗ go build -tags=retrynotrace -ldflags=-dumpdep ./interceptors/retry/main |& whydeadcode

* add new build tag `-build=retrynotrace` to support dead code elimination
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

Successfully merging this pull request may close these issues.

1 participant