Skip to content

binary size increase #1532

Answered by skmcgrail
hrez asked this question in Q&A
Dec 7, 2021 · 5 comments · 1 reply
Discussion options

You must be logged in to vote

There is a number of conflating factors here that need to be teased apart to understand the behavior you are seeing.

  • The Go compiler/linker will attempt to not link in code into your binary that it can prove is not required by your application.
  • Removing deadcode like unused methods receivers on types (for example all the API operations on the ec2.Client type requires proof that the type is not used directly, is not reachable as an interface type, or that the reflection package's Method or MethodByName methods are not used which could potentially invoke the methods at runtime.
  • The code example you are using to show off the approach is inherently imperfect since it actually is passing the …

Replies: 5 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by vudh1
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@djedward
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
guidance Question that needs advice or information.
5 participants
Converted from issue

This discussion was converted from issue #1524 on December 13, 2021 23:40.