[go-nuts] Re: the size of the files compiled in GO

2020-04-19 Thread Jan Flyborg
Please take a look here: 
https://stackoverflow.com/questions/28576173/reason-for-huge-size-of-compiled-executable-of-go

You can probably make it much smaller by just stripping the binary, and for 
those cases where you want it to be even smaller, you can always use UPX 
(but that comes with a price in the form of slower startup and higher 
memory usage).

On Saturday, April 18, 2020 at 7:26:11 PM UTC+2, jare...@gmail.com wrote:
>
> Why does the simple Hello world program take 2 MB after compilation?
>

-- 
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/c792317e-70f8-4e78-a260-ad265c6e0a5b%40googlegroups.com.


[go-nuts] Cross compiling with CGO without having a C compiler for each target platform

2020-02-26 Thread Jan Flyborg
We are building a system that targets many different combinations of OS's 
and architectures.

Up until now we have been able to keep the whole code base and external 
packages in pure Go (no CGO), which means that the cross compiler 
functionality of GC has been sufficient for us.

However, recently we have introduced a dependency to an SQLite library 
(https://github.com/mattn/go-sqlite3) which needs CGO and I want to avoid 
having each developer to install C compilers for all combinations, so I'm 
investigating if it would be possible to simplify this process.

So let's say I am running Linux/AMD64 on my PC and that my colleague is 
using a Windows machine. Could I build the CGO part on my machine as an 
archive file and then ship this archive to my colleagues machine in order 
to make it possible for him to change GOOS and GOARCH to Linux/AMD64 and 
thereby enabling him to cross compile (with "go build") for this 
architecture (without having a C compiler for Linux/AMD64 available)?

Is this possible or do we always have to have a C-toolchain available on 
the machine where we perform the cross compilation?

Best Regards
//Jan Flyborg

-- 
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/660a29f0-7dc9-43c6-ad46-6dd26ff5146e%40googlegroups.com.