I have a main.go file with a glide.yaml file (see below for source code) in a clean gopath (No other repositories)
Running go get -u ./...
then go build main.go
generates a binary of size 2377872 bytes.
Cleaning the gopath of any repos that were cloned from go get
, and running glide update
then go build main.go
generates a binary of size 2457328 bytes.
Why are binaries of different sizes, if there was no code changes?
What does go build
do differently? Why does having a vendor directory (or not having one) affect this size?
Software versions used
glide version 0.13.1
go version go1.10.3 darwin/amd64
main.go
package main
import (
log "github.com/sirupsen/logrus"
)
func main () {
log.WithFields(log.Fields{
"qqs": "q1",
}).Info("Why are binaries different?")
}
glide.yaml
package: github.com/chuyval/qqs/q1
import:
- package: github.com/sirupsen/logrus
version: 1.0.6