groups command on linux can be used to know which all groups a user belongs to Just type in groups on the terminal. Below is the output on my Mac machine
Category: Tech
Ruby convert string to bool
Overview In the Ruby language, strings “true” and “false” are interpreted as true when used in the if condition. See example below Output “false” evaluates to true Therefore it becomes important to…
Know the current user on Linux
Overview Linux command ‘whoami’ can be used to know the currently logged-in user. Let’s see this command in action. Go to the terminal and type in the command It will print the…
Convert an array of int or numbers to string in Go (Golang)
Overview In this tutorial, we will see how to convert an array of ints or numbers to a string in Go. Below is the program for the same. Program Here is the…
Check if a string contains single or multiple whitespaces in Go (Golang)
Overview A simple regex can be used to check if a string contains single or multiple white spaces in Go. Here is the program for the same Program Output Note: Check out…
Create or initialize a new string in Go (Golang)
Overview Below is a simple way to initialize or create a string in Go. In the below program, we have simply declared as well as defined a string named sample Notice the…
Delete or Remove a key from a map in Go (Golang)
Overview Below is the format to delete a given key from a map There are two cases Let’s see an example of both the cases Key exists in the Map Below is…
Convert an IOTA or Enum to a string in Go (Golang)
Overview Enum in Golang can be created by using IOTA. Please refer to this post to learn more about IOTA In this post, we will see how to convert an IOTA or…
Enum in Golang
Overview IOTA provides an automated way to create an enum in Golang. Let’s see an example. Example Output In above program we created a new type Then we declared some const of …
Sort a slice of Int in Ascending and Descending order in Go (Golang)
Sort a slice in Ascending order sort.Ints package of going can be used to sort a full slice or a part of the slice. It is going to sort the string into…