It seems you not interact with data variable in main or other places, so go
automatically drop it
Just add `print(len(data))` or something like this in main function and
binary instantly grow up
пятница, 16 декабря 2022 г. в 10:15:24 UTC+3, Aurora:
> By empty, I mean it didn't actually
By empty, I mean it didn't actually contain any actual data, just zeros.
That's why it's being compressed that much.
I embedded the file into the Go code using the standard embed directive.
```
package main
import _ "embed"
//go:embed .empty
var data []byte
```
On Friday, 16 December
Please clarify what you mean by "embedded an empty 100MB file". What
does "empty" mean and how did you "embed" it? Can you show us an example of
what you're trying to do (obviously replacing the 100MB of "empty" with a
placeholder).
On Thu, Dec 15, 2022 at 10:58 AM Aurora wrote:
> I've embedded
I've embedded an empty 100MB file in my Go code, for some testing purposes.
When I run 'go build', the binary output would be something around 20MB.
I want the output binary to be more than 100MB, its real size.
How's this compression being applied to the binary?
How to disable all such