How To Install golang-easyjson on Ubuntu 18.04

In this tutorial we learn how to install golang-easyjson on Ubuntu 18.04. golang-easyjson is Fast JSON serializer for golang

Introduction

In this tutorial we learn how to install golang-easyjson on Ubuntu 18.04.

What is golang-easyjson

golang-easyjson is:

easyjson allows (un-)marshaling of JSON golang structs without the use of reflection by generating marshaller code.

One of the aims of the library is to keep generated code simple enough so that it can be easily optimized or fixed. Another goal is to provide users with ability to customize the generated code not available in ’encoding/json’, such as generating snake_case names or enabling ‘omitempty’ behavior by default.

This package contains the command-line client.

There are three methods to install golang-easyjson on Ubuntu 18.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install golang-easyjson Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install golang-easyjson using apt-get by running the following command:

sudo apt-get -y install golang-easyjson

Install golang-easyjson Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install golang-easyjson using apt by running the following command:

sudo apt -y install golang-easyjson

Install golang-easyjson Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install golang-easyjson using aptitude by running the following command:

sudo aptitude -y install golang-easyjson

How To Uninstall golang-easyjson on Ubuntu 18.04

To uninstall only the golang-easyjson package we can use the following command:

sudo apt-get remove golang-easyjson

Uninstall golang-easyjson And Its Dependencies

To uninstall golang-easyjson and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove golang-easyjson

Remove golang-easyjson Configurations and Data

To remove golang-easyjson configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge golang-easyjson

Remove golang-easyjson configuration, data, and all of its dependencies

We can use the following command to remove golang-easyjson configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge golang-easyjson

References

Summary

In this tutorial we learn how to install golang-easyjson package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.