Swagger UI is a great tool and a must have for any respectable API project. It has an intuitive design, all endpoints can be tested from the interface.
Today we found that our web server written in Go has memory leaks and consume around 300M of memory, which is really a lot for our app.
The Go language comes with a powerful built-in template engine. In Go, we have the template package to help handle templates. We can use functions like Parse, ParseFile and Execute to load templates from plain text or files, then evaluate the dynamic parts.
Today I saw that the size of my vendor/ folder in Golang project is around 150M. I am using glide there and there are 24 dependencies (it’s a program with multiple data storage connectors, notifications, etc.
What does data race mean in Golang? Data race is a common mistake in concurrent systems. A data race occurs when two goroutines access the same variable concurrently and at least one of the accesses is a write.
This post shows how to marshall NULL values from the database into Go struct and how to avoid mistakes during fetching optional values with SELECT query.
~21MB Well, I found yesterday that LogPacker Daemon weights about 21MB. This application is written in Go language, it’s really doing a lot of things, has built-in connectors to different Data-Storages, has Cluster solution inside, etc.
30 basic questions to measure your Golang knowledge. Answers and .go files you can find on GitHub page. Don’t hesitate to create a Pull Request in case of some found errors, typos.
go test -bench=. Go has a great option to write your benchmarks and run it together with go test with option -bench. To create a benchmark function you must do the following:
gomobile bind With gomobile we can generate language bindings that make it possible to call Go functions from Java. And it’s awesome. Now you can write Android applications in Go (unfortunately without UI features and with pure SDK coverage, but I hope it will grow up from experiment to production-ready tool).