- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Mukul Latiyan has Published 474 Articles
![Mukul Latiyan](https://www.tutorialspoint.com/assets/profiles/308320/profile/60_124990-1617352847.jpg)
Mukul Latiyan
741 Views
We know that maps in Go contain key-value pairs. There are often instances where we would want to know that a certain key exists in a map or not, in such cases, we have two options available.The first approach is very naive, as in this approach, we basically iterate over ... Read More
![Mukul Latiyan](https://www.tutorialspoint.com/assets/profiles/308320/profile/60_124990-1617352847.jpg)
Mukul Latiyan
1K+ Views
We often want to replace certain strings or all the strings that match a pattern with some other string. In order to do that in Golang, we can either use the native functions that the strings package of Go's standard library provides us with or we can write the logic ... Read More
![Mukul Latiyan](https://www.tutorialspoint.com/assets/profiles/308320/profile/60_124990-1617352847.jpg)
Mukul Latiyan
2K+ Views
To read a CSV file in Go, the first thing that we need to make use of is the encoding/csv package that the Go standard library provides us with. The encoding/csv package contains different functions and methods that can be used when we want to read data from a CSV ... Read More
![Mukul Latiyan](https://www.tutorialspoint.com/assets/profiles/308320/profile/60_124990-1617352847.jpg)
Mukul Latiyan
4K+ Views
Many languages do provide a method similar to indexOf() where one can find the existence of a particular element in an array-like data structure. However, in Golang, there's no such method and we can simply implement it with the help of a for-range loop.Let's suppose we have a slice of ... Read More
![Mukul Latiyan](https://www.tutorialspoint.com/assets/profiles/308320/profile/60_124990-1617352847.jpg)
Mukul Latiyan
624 Views
Number parsing in Go is about converting the numbers that are present in string form to number form. By number form, we mean that these numbers can either be converted into integers, floats, etc.The most widely used package for number parsing is the "strconv" package that Go library provides us ... Read More
![Mukul Latiyan](https://www.tutorialspoint.com/assets/profiles/308320/profile/60_124990-1617352847.jpg)
Mukul Latiyan
4K+ Views
In Go, we have a package named time that is present in Go's standard library. This time package contains different useful functions that we can use to calculate the time taken by a code block or even a function in Go.The most widely used functions are time.Sleep(), time.Since() and time.Now(). ... Read More
![Mukul Latiyan](https://www.tutorialspoint.com/assets/profiles/308320/profile/60_124990-1617352847.jpg)
Mukul Latiyan
361 Views
In order to understand what closures are, we must know what anonymous functions are and how we can use them.Anonymous functionsIn Go, anonymous functions are those functions that don't have any name. Simply put, anonymous functions don't use any variables as a name when they are declared.We know that we ... Read More
![Mukul Latiyan](https://www.tutorialspoint.com/assets/profiles/308320/profile/60_124990-1617352847.jpg)
Mukul Latiyan
3K+ Views
We know that every code in Golang is present inside a package, which can either be an executable one or a utility one. The executable package name is usually main and the name of the utility package can be anything, in most cases, it is the name of the folder.Suppose ... Read More
![Mukul Latiyan](https://www.tutorialspoint.com/assets/profiles/308320/profile/60_124990-1617352847.jpg)
Mukul Latiyan
8K+ Views
To read a file into a string, we need to make use of the io/ioutil package that Go's standard library provides us with.Inside the io/ioutil package, there's a function called ReadFile() which is used to open a file and then convert its contents into a slice of bytes, and if ... Read More
![Mukul Latiyan](https://www.tutorialspoint.com/assets/profiles/308320/profile/60_124990-1617352847.jpg)
Mukul Latiyan
8K+ Views
Suppose we want to read a JSON file in Go. By reading, we mean that we want to convert the file data into a struct in Go.Consider the JSON file shown below that we will use to read and then convert the data into the structure.{ "users": [ ... Read More