How To Install golang-go.uber-zap-dev on Ubuntu 18.04
Introduction
In this tutorial we learn how to install golang-go.uber-zap-dev on Ubuntu 18.04.
What is golang-go.uber-zap-dev
golang-go.uber-zap-dev is:
Package zap provides fast, structured, leveled logging.
For applications that log in the hot path, reflection-based serialization and string formatting are prohibitively expensive, they’re CPU-intensive and make many small allocations. Put differently, using json.Marshal and fmt.Fprintf to log tons of interface{} makes your application slow.
Zap takes a different approach. It includes a reflection-free, zero-allocation JSON encoder, and the base Logger strives to avoid serialization overhead and allocations wherever possible. By building the high-level SugaredLogger on that foundation, zap lets users choose when they need to count every allocation and when they’d prefer a more familiar, loosely typed API.
There are three methods to install golang-go.uber-zap-dev 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-go.uber-zap-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-go.uber-zap-dev using apt-get by running the following command:
sudo apt-get -y install golang-go.uber-zap-dev
Install golang-go.uber-zap-dev Using apt
Update apt database with apt using the following command.
sudo apt update
After updating apt database, We can install golang-go.uber-zap-dev using apt by running the following command:
sudo apt -y install golang-go.uber-zap-dev
Install golang-go.uber-zap-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 Ubuntu. Update apt database with aptitude using the following command.
sudo aptitude update
After updating apt database, We can install golang-go.uber-zap-dev using aptitude by running the following command:
sudo aptitude -y install golang-go.uber-zap-dev
How To Uninstall golang-go.uber-zap-dev on Ubuntu 18.04
To uninstall only the golang-go.uber-zap-dev package we can use the following command:
sudo apt-get remove golang-go.uber-zap-dev
Uninstall golang-go.uber-zap-dev And Its Dependencies
To uninstall golang-go.uber-zap-dev and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:
sudo apt-get -y autoremove golang-go.uber-zap-dev
Remove golang-go.uber-zap-dev Configurations and Data
To remove golang-go.uber-zap-dev configuration and data from Ubuntu 18.04 we can use the following command:
sudo apt-get -y purge golang-go.uber-zap-dev
Remove golang-go.uber-zap-dev configuration, data, and all of its dependencies
We can use the following command to remove golang-go.uber-zap-dev configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge golang-go.uber-zap-dev
References
Summary
In this tutorial we learn how to install golang-go.uber-zap-dev package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.