Akhil Sharma has Published 550 Articles

Golang program to convert milliseconds to minutes and seconds

Akhil Sharma

Akhil Sharma

Updated on 03-May-2023 13:03:39

In this golang article, we will write Go language programs to convert milliseconds to minutes and seconds using various methods. Milliseconds are converted to minutes and seconds mathematically using different set of logics. Algorithm Step 1 − Import the required packages in the program Step 2 − Create a ... Read More

Golang program to create multiple BEGIN and END blocks

Akhil Sharma

Akhil Sharma

Updated on 03-May-2023 13:02:46

In this article, we will learn to write Go language programs that will create multiple BEGIN and END blocks using curly braces, “conditional statements”, as well as “external functions”. A block is created using curly braces, the scope of a variable remains inside the block and not outside it. Algorithm ... Read More

Golang program to demonstrate BEGIN and END blocks

Akhil Sharma

Akhil Sharma

Updated on 03-May-2023 13:01:43

In this Go language article, we will write programs to demonstrate BEGIN and END blocks using sum of numbers, iteration and two variables. Blocks are used to group the statements where the variables described in the block can only be used in that scope and not outside it. They also ... Read More

Golang program to format time in AM-PM format

Akhil Sharma

Akhil Sharma

Updated on 03-May-2023 13:01:03

In Go language article, we will write programs to format time in AM-PM format using now and format package, as well as using now and format function with minutes and seconds. The current time can be obtained using Now function from the time package whereas we can format the time ... Read More

Golang program to display current date and time

Akhil Sharma

Akhil Sharma

Updated on 03-May-2023 12:58:46

In Golang we can display current date and time using “now and format function”, “now function”, and “strconv package” to display the current date and time. In this article we are going to learn how to create a golang program to display current date and time using various Examples. Syntax ... Read More

Golang program to get the hash elements as a sorted array from the hash collection

Akhil Sharma

Akhil Sharma

Updated on 03-May-2023 12:54:13

In golang we can obtain the hash elements as a sorted array from the hash collection using iteration, sort package as well as slice function. A hash collection contains a hashmap which is used to store items in the form of key value pairs. A hashmap is implemented using a ... Read More

Golang program to replace the items of hash collection from another hash collection

Akhil Sharma

Akhil Sharma

Updated on 03-May-2023 12:53:21

In this Go language article, we learn how to replace the items of hash collection from another hash collection using ok idiom method as well as a loop to replace the items of hash collection. A hash collection contains a hashmap which is an efficient data structure Syntax func range(variable) ... Read More

Golang program to delete the item from the hash collection based on a specific key

Akhil Sharma

Akhil Sharma

Updated on 03-May-2023 12:51:24

In this article, we will learn how tp write a Go language programs to delete the item from the hash collection based on a specified key using ok idiom method and delete keyword A hash map is a part of the hash collection. It stores the data as key value ... Read More

Golang program to get value from the hash collection based on specified key

Akhil Sharma

Akhil Sharma

Updated on 03-May-2023 12:20:11

In this golang article, we will write Go language programs to get the value from the hash collection based on a specified key using found variable as well as using ok idiom method. A hash map is a data structure that belongs to the hash collection. It stores the data ... Read More

Golang Program to check a file has readable permission or not

Akhil Sharma

Akhil Sharma

Updated on 03-May-2023 12:17:05

While working with file in go language it is very important to check if a file has readable permission or not, because without the read permissions a program cannot read the content of files. Here we will use os.Stat() function , os.Open() function, as well as ,ioutil.Readfile() function to ... Read More

Advertisements