2020
12-17
12-17
减少 golang 二进制文件大小操作
环境:$goversiongoversiongo1.11.2linux/amd64$gcc--versiongcc(Ubuntu5.4.0-6ubuntu1~16.04.10)5.4.020160609一.GoVSC二进制hello.gopackagemainimport"fmt"funcmain(){fmt.Println("helloworld")}hello.c#include<stdio.h>intmain(){printf("helloworld\n");return0;}$gobuild-ohellohello.go$gobuild-ldflags"-s-w"-ohello2hello.go$gcchello.c$ls-l-rwxrwxr-x1zengxlzengxl...
继续阅读 >