go

11 posts
go

5 advanced testing techniques in Go

Use test suites - develop tests written against an interface for all implementations of that interface. Carefully consider interfaces before exporting them and avoid creating a hard dependency between a consumer package and your own.…

go

How we improved the observability of a Go project

Add comprehensive info-level logging coverage to make each step of processing more observable. Structure logging with log levels using the logrus package to eliminate noise and improve searchability within logs, and impose consistency.…

go

How we implemented domain-driven development in Golang

Some learnings from Grab’s implementation of the principles of domain-driven development (DDD) and idiomatic Go.…

security

Top security best practices for Go

You should validate user entries (using native Go packages or 3rd party packages) not only for functionality but also to avoid attackers sending intrusive data.…

Issue64

Go: best practices for production environments

Use a single, global GOPATH for your development environments. Try cloning your repos into their canonical paths within the GOPATH, and work there directly.…

Issue62

The value in Go’s simplicity

Super strong forward compatibility with careful attention to versioning and dependency. Great restraint to add ‘good-to-haves’ versus what you really need.…

Issue50

Don’t just check errors, handle them gracefully

Best option to use is an opaque error strategy that requires the least coupling between code and caller. The caller only knows an error happened, but they can’t see inside the error.…

Issue42

5 things Rob Pike attributes Go’s success to

Writing a formal specification of the language. Making Go attractive for app developers to use. Establishing a strong open-source community.…

Issue40

Security assessment techniques for Go projects

Static analysis tools like gosec, go-vet, and staticcheck can help catch low hanging fruits not included in compiler errors & warnings. Dynamic analysis techniques like fuzzing, property testing & fault injection should be used for deeper results.…

Issue24

Most common mistakes I’ve seen in Go projects

Unknown enum value. Relying too much on pointers for speed. Misunderstanding context. Not using the -race option.…