How To Install golang-github-mitchellh-mapstructure-dev on Debian 10
Introduction
In this tutorial we learn how to install golang-github-mitchellh-mapstructure-dev
on Debian 10.
What is golang-github-mitchellh-mapstructure-dev
golang-github-mitchellh-mapstructure-dev is:
mapstructure is a Go library for decoding generic map values to structures and vice versa, while providing helpful error handling.
This library is most useful when decoding values from some data stream (JSON, Gob, etc.) where you don’t quite know the structure of the underlying data until you read a part of it. You can therefore read a map[string]interface{} and use this library to decode it into the proper underlying native Go structure.
Go offers fantastic standard libraries for decoding formats such as JSON. The standard method is to have a struct pre-created, and populate that struct from the bytes of the encoded format. This is great, but the problem is if you have configuration or an encoding that changes slightly depending on specific fields.
Perhaps we can’t populate a specific structure without first reading the “type” field from the JSON. We could always do two passes over the decoding of the JSON (reading the “type” first, and the rest later). However, it is much simpler to just decode this into a map[string]interface{} structure, read the “type” key, then use something like this library to decode it into the proper structure.
There are three methods to install golang-github-mitchellh-mapstructure-dev
on Debian 10. 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-github-mitchellh-mapstructure-dev 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-github-mitchellh-mapstructure-dev
using apt-get
by running the following command:
sudo apt-get -y install golang-github-mitchellh-mapstructure-dev
Install golang-github-mitchellh-mapstructure-dev Using apt
Update apt database with apt
using the following command.
sudo apt update
After updating apt database, We can install golang-github-mitchellh-mapstructure-dev
using apt
by running the following command:
sudo apt -y install golang-github-mitchellh-mapstructure-dev
Install golang-github-mitchellh-mapstructure-dev 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 Debian. Update apt database with aptitude
using the following command.
sudo aptitude update
After updating apt database, We can install golang-github-mitchellh-mapstructure-dev
using aptitude
by running the following command:
sudo aptitude -y install golang-github-mitchellh-mapstructure-dev
How To Uninstall golang-github-mitchellh-mapstructure-dev on Debian 10
To uninstall only the golang-github-mitchellh-mapstructure-dev
package we can use the following command:
sudo apt-get remove golang-github-mitchellh-mapstructure-dev
Uninstall golang-github-mitchellh-mapstructure-dev And Its Dependencies
To uninstall golang-github-mitchellh-mapstructure-dev
and its dependencies that are no longer needed by Debian 10, we can use the command below:
sudo apt-get -y autoremove golang-github-mitchellh-mapstructure-dev
Remove golang-github-mitchellh-mapstructure-dev Configurations and Data
To remove golang-github-mitchellh-mapstructure-dev
configuration and data from Debian 10 we can use the following command:
sudo apt-get -y purge golang-github-mitchellh-mapstructure-dev
Remove golang-github-mitchellh-mapstructure-dev configuration, data, and all of its dependencies
We can use the following command to remove golang-github-mitchellh-mapstructure-dev
configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge golang-github-mitchellh-mapstructure-dev
Dependencies
golang-github-mitchellh-mapstructure-dev have the following dependencies:
References
- golang-github-mitchellh-mapstructure-dev website
- golang-github-mitchellh-mapstructure-dev on packages.debian.org
Summary
In this tutorial we learn how to install golang-github-mitchellh-mapstructure-dev
package on Debian 10 using different package management tools: apt
, apt-get
and aptitude
.