There's some you must consider when using older Go version (<1.4.3):
- Broken libraries, some libraries (such as fasthttp) doesn't support older version of Go (<1.5), because there are changes on standard libraries, for example there's no bytes.LastIndexByte, bufio.Reader.Discard, time.Time.AppendFormat, etc on older version of go standard library)
- Slower GC (see Go 1.6 latest low latency garbage collector, it's even less than 21ms)
- Bigger binary produced (but see goupx)
- Slower runtime performance (but it's already fast compared to another language)
- No Vendoring (see no more dependency hell)
- And lastly, no Cross Compiling!
$ go build
-rwxr-xr-x 1 asd staff 11261296 Jun 5 19:41 PUPS
PUPS: Mach-O 64-bit executable x86_64
$ env GOOS=linux GOARCH=amd64 go build
-rwxr-xr-x 1 asd staff 9232191 Jun 5 19:42 PUPS
PUPS: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped
$ env GOOS=windows GOARCH=386 go build
-rwxr-xr-x 1 asd staff 8048640 Jun 5 19:42 PUPS.exe
PUPS.exe: PE32 executable for MS Windows (console) Intel 80386 32-bit
This feature is really useful especially when your server is Linux, but you develop in Mac :3
Or when you want to create a cross-platform games/apps.
No comments:
Post a Comment
THINK: is it True? is it Helpful? is it Inspiring? is it Necessary? is it Kind?