Swaggerize your APIs · · Go Swaggger
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. For example, let’s have a look at Kubernetes API, where endpoints are grouped by version, and everything is accessible in easy way. In this post I’ll show how to build it together with your API written in Go.Read more
Golang Docker Skeleton · · Go Docker
I really like templates and standards in the companies or a single team. Of course each company has it’s own application layout, because it depends on tools, people and goals. Also everyone wants to save a time. In the SOA century we have to create new projects, repositories more often and often, create
Dockerfile again, think about layout, write a documentation. In this post I want to share my template created for Go applications that work in Docker, which I am using in my projects.
Memory leaks with mux.Router in Go · · Go Memory Profiling
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. After restart it’s back to ~10M but each hour increased by few more. Golang has nice built-in tools to debug and find leaks.Read more
Go templates. Helper to render a struct · · Go
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
Execute to load templates from plain text or files, then evaluate the dynamic parts. Also it’s possible to create user-defined functions and call it from templates.
UUID without dependencies in Go · · Go glide
Today I realized that size of my
vendor/ folder in Golang project is around 150M. I am using
glide there. There are 24 dependencies (it’s a program with multiple data storage connectors, notifications, etc.), so I decided to review it and reduce amount of 3rd party libraries.
First of all I have checked
glide-report and removed 2 unused packages. Go-world has a lot of packages that are awesome and can save your time, but not your program’s performance. I found few packages which I am using as helpers. For example gouuid.
Concurrency. Data race · · Go Concurrency
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. It’s really hard to recognize it without specific tools or without an eagle eye, because when you run a program it’s always a chance that you won’t see your mistake or it will be very transparent.Read more
Working with ClickHouse in Go. Part 1: Basics · · Go ClickHouse
ClickHouse is an open-source column-oriented database management system that allows generating analytical data reports in real time. Created by Yandex developers for internal purposes, but then has migrated as open-source tool. It currently powers Yandex.Metrica, world’s second largest web analytics platform, with over 13 trillion database records and over 20 billion events a day, generating customized reports on-the-fly, directly from non-aggregated data. So it is really fast.Read more
Game Of Logs: 2 tests about Go · · Go LogPacker
In LogPacker we have prepared 4 interactive tests, 2 for Golang and 2 for Docker. Enjoy and share results!
Golang War I
Golang War IIRead more
Working with DB nulls in Golang · · Go DB
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. I’ll show standard types sql.NullString, sql.NullInt64, etc types.Read more
GoMobile: Library development for IOS/Android · · Mobile Go LogPacker Android Java iOS
Read full article
Cross platform development of mobile applications was quite popular back then. This approach was used by most companies in the time of mobile branch establishment. The main reasons for using this approach were simple – lack of professionals in the market, slow development speed and unreasonable cost. Unfortunately, in most cases this approach did not justify itself. But why not to give that approach the second chance? Technology took a big step forward and theoretically we can get a high-quality product. In this article we’ll review in practice how to develop Library for iOS/Android in Golang and have a look at the problems and constraints faced in the development process.Read more