Just migrated our Open Source project to Golang
github.com
github.com
Why? If you go build cmd/digger/main.go you end up with main, if renamed you end up with digger. Without using additional -o flags.
Also consider https://goreleaser.com/intro/
Faster runtimes (upto 30x faster)
Can be compiled into single binary, advantages for Github actions is that we don’t need to wrap action into Dockerfile.
Easy to compile binary to multiple platforms, it helps us run from same codebase.
Interface based development , more guarantees about the code correctness by the compiler when compared to using Python.
Golang is more popular in the DevOps and infrastructure community, we can find several libraries and reuse them in our code.
Would love to hear from HN on our code quality! Please be as critical as possible!
- use of utils package
- use of models package
- naming of receivers (too long)
- returning empty structs instead of (nil) pointers
- too much log.Fatal scattered around the code
- unhandled errors, inconsistent error handling
sometimes handled twice a la log.Printf(..., err) then return err
consider error wrapping here
- useless use of err2 variables
- use of Must functions which will panic if fail, transition to err producing fns
- stuttering (digger.DiggerConfig)
- naming things ...Impl instead of naming the interface ...er || ..or
This is done correctly in tf.go, not so good in locking.go
For a complete review i would need more time.We actually have an SCP that `Deny`s `iam:CreateAccessKey` in our Organization(s)