How to reduce compiled file size?

前端 未结 12 744
野性不改
野性不改 2020-11-28 20:59

Lets compare c and go: Hello_world.c :

#include
int main(){
    printf(\"Hello world!\");
}

Hello_world.go:

         


        
12条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-28 21:44

    From Go 1.8 you can also use the new plugin system to split up your binary into something that resembles shared libraries. For this release it only works on Linux, but other platforms will probably be supported in the future.

    https://tip.golang.org/pkg/plugin/

提交回复
热议问题