Skip to main content

Concurrency with Goroutines in Golang

In our previous tutorial, we have explained how to work with Maps in Golang. In this tutorial, we will explain about Goroutines in Golang. Goroutines are functions in Golang that are run concurrently which means multiple operations can be handled at the same time. It’s about creating and executing multiple processes independently.

With Goroutines, we can easily convert sequential programs into concurrent program without having to worry about thread pools as the Golang creates very light-weight threads that’s managed by Go runtime. (more…)

Working with Maps in Golang

In our previous tutorial, we have explained how to handle Marshalling and Unmarshalling in Golang. In this tutorial, we will explain about Maps in Golang. Map in Golang is a data structure that provides an unordered collection of keys/values pairs. Golang maps are same like associative arrays, hash or dictionaries in other programming languages.

The maps are used to store and access values based on key. A key works like an index, pointing to the value associate with that key. A map data structure is used for fast lookup, retrieval and deletion of the data based on keys. (more…)

Marshalling and Unmarshalling in Golang

In this tutorial, we will explain how to encode and decode data in Golang. Data encoding is an important part of any programming language to encode data into JSON or decode data into String.

In Golang, struct data is converted into JSON and JSON data to string with Marshal() and Unmarshal() method. The methods returned data in byte format and we need to change returned data into JSON or String.

In our previous tutorial, we have explained about Parsing JSON Data in Golang. In this tutorial, we will explain about data marshal and unmarshal in Golang. (more…)

AWS S3 File Upload in Golang

AWS S3 or Amazon S3 is a storage system from Amazon to store and retrieve files from anywhere on the web. It is a highly scalable, reliable, fast, inexpensive data storage system from Amazon. It provides easy to use developer kit to store and retrieve files.

As in our previous Go tutorial, you have learned how to write data to CSV file in Golang. In this tutorial you will learn how to upload files to AWS S3 using Golang. We will use the Go AWS SDK to upload files to AWS S3. (more…)

Write Data to CSV File using Golang

CSV (Comma Separated Value) is the most used file format to store and share the data. It is widely used in web applications to export and import dynamic data.

In our previous tutorial you have learned how to read CSV file in Golang. In this tutorial you will learn how to write data to the CSV file using Golang. The Go has encoding/csv package which has NewWriter() method. The NewWriter() method returns a Writer object which is used for writing CSV data. The csv.Writer obejct writes csv records which are terminated by a newline and uses a comma as the field delimiter.

We will cover this tutorial step by step to create CSV file and write to records to CSV file using Golang. (more…)