Advanced Error Handling in Golang 2 minute read Published: 25 Sep, 2017 Tagged: go If you have ever written any Golang code you have probably noticed the built-in error type interface. Golang uses error values to indicate an abnormal state. The error type represents any value that can describe itself as a string. Here is the interface’s declaration: type error interface { Error() string } The most commonly-used error implementation is the errors package’s implementation that allows you to instantiate errors by using the following code snippet:

Network Programming and Proxies in Golang 3 minute read Published: 22 Aug, 2017 Tagged: go Learn how to use Proxy to establish TCP connections in Golang Have you used any proxy servers in your infrastructure? There are a lot of different scenarios in which you may use a proxy in order to control access to your machines and resources. I am not saying that it’s the best approach but some companies use that. Recently, I have been working on a TCP service that has to connect via SOCK5 proxy server. But before we dig into that, I would like to show what Golang offers for the regular HTTP user.

Working with FTP protocol in Golang 2 minute read Published: 3 Apr, 2017 Tagged: golang backend One of the benefits of using Golang is its http package that provides an easy way to build robust REST APIs. Unfortunately, it does not provide out of the box away to build FTP server or connect to FTP server. In this article, we will explore that by demonstrating the usage of two third party packages that allow that. Connecting to FTP server The most robust and broadly used package that provides an FTP client build by Julien.

Golang: Extending reflect.StructTag to support duplicates 3 minute read Published: 21 Mar, 2017 Tagged: go reflect json Presently, Golang has limited support of reflection comparing to the mainstream languages like C# and JAVA. It’s not intended to match or beat that languages. In practice, we are using StructTag to add some metadata for the defined struct fields. Such an example is json package, where you can customize the field marshaling. In example below, we customize the json representation of User struct fields: type User struct { ID string `json:"id"` Name string `json:"name"` CreatedAt time.