Open justfalter opened 1 month ago
Compare the two:
The following compiles to 6.6MB w/ go1.22.5 on osx (arm64)
package main import ( "github.com/magiconair/properties" ) func main() { _, err := properties.LoadFile("./config.properties", properties.UTF8) if err != nil { panic(err) } }
The following compiles to 3.7MB:
package main import ( "github.com/magiconair/properties" ) func main() { loader := &properties.Loader{Encoding: properties.UTF8} _, err := loader.LoadFile("./config.properties") if err != nil { panic(err) } }
The reason for this is because properties.LoadFile funnels through Loader.LoadAll, which can load properties files from URLs, so net/http and everything gets pulled in.
properties.LoadFile
Compare the two:
The following compiles to 6.6MB w/ go1.22.5 on osx (arm64)
The following compiles to 3.7MB:
The reason for this is because
properties.LoadFile
funnels through Loader.LoadAll, which can load properties files from URLs, so net/http and everything gets pulled in.