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 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 2022 at 01:15:48 UTC+3:30 kra...@skepticism.us 
> wrote:
>
>> 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 <aurora...@gmail.com> wrote:
>>
>>> 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 optimisations?
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "golang-nuts" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to golang-nuts...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/golang-nuts/344ddfba-aea4-4631-b283-202a967f4b02n%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/golang-nuts/344ddfba-aea4-4631-b283-202a967f4b02n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>> -- 
>> Kurtis Rader
>> Caretaker of the exceptional canines Junior and Hank
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/9798befa-9b87-4640-9e44-84c001ab1aacn%40googlegroups.com.

Reply via email to