- 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
Found 545 Articles for Go Programming

Updated on 21-Feb-2023 12:16:29
In the Go programming language, a linkedlist is a data structure made up of a series of nodes, each of which has a value and a reference (pointer) to the node after it. Since items can be added to or removed from a list without rearranging the entire data set, linked lists offer a dynamic and adaptable approach to store data. Using structs and pointers, linked lists can be implemented in Go whereas array is a fixed-size group of identical elements that may be accessed by their respective indexes, which are integers with a zero-based basis. An array's size is ... Read More 
Updated on 21-Feb-2023 12:15:32
We can use chmod function and syscall package in Golang to make a file read-only file. To convert a file into read-only files, the chmod function set the file’s right to 044. The os.Chmod function is then used to modify the file's mode. In syscall package of Golang we are going to use os.stat function to obtain information about the file. Method 1: Using chmod function This program employs the Chmod function to modify a file's permissions using the os package. Syntax os.Chmod In Go, this function belongs to the os package. The main goal of this function is ... Read More 
Updated on 21-Feb-2023 12:14:20
In go programming language we can use os.create and ioutil.WriteFile to write into a file. In Go, the OS can be used to represent a file. os package file type that offers ways to open, read from, write to, and manipulate files. Method 1: Using os.Create function We make use of the os.Create in this program to start a new file or, if one already exists, to open it. The file is deferred while a string is written using the WriteString function. Close makes ensuring that when the application ends, the file is correctly closed. Syntax Os.Create In ... Read More 
Updated on 21-Feb-2023 12:13:30
In Go programming language we can use ioutil.TempFile function to create a temporary file. To create a new temporary file in the default temporary directory, this program uses the ioutil. TempFile function. The directory in which the file should be created is the first argument to TempFile, and the pattern to use for the file name is the second argument. The pattern in this instance is "temp-*.txt, " leading to a file name like "temp-123456789.txt". Syntax Ioutil.TempFile In Go programming language, this function is a part of ioutil package and is used to create a temporary file. A ... Read More 
Updated on 21-Feb-2023 12:12:31
Golang has two internal function – os.create and ioutil.WriteFile to create a new file. The "file" is a disk-based file that a Go program may read from or write to. In Go, the OS can be used to represent a file. os package file type that offers ways to open, read from, write to, and manipulate files. Method 1: Using os.Create Command In this method, the os.Create function uses the specified name to create a new file or truncate an existing one. When the function has completed running, the file is closed using the defer command. Syntax Os.Create ... Read More 
Updated on 21-Feb-2023 12:11:15
In Go programming language we can use byte function and ioutil.ReadFile function to convert a file into byte array. The os package file type that offers ways to open, read from, write to, and manipulate files whereas array is a fixed-size group of identical elements that may be accessed by their respective indexes, which are integers with a zero-based basis. An array's size is predetermined at the moment of declaration and cannot be altered later on. When storing a set of data with a known number of elements, arrays in Go are handy, but they have some drawbacks, such as ... Read More 
Updated on 21-Feb-2023 12:09:50
In Golang, we can use node struct and linkedlist struct to add elements to a linkedlist. A linkedlist is a data structure made up of a series of nodes, each of which includes an element and a reference to the node after it in the sequence. It is a linear data structure with pointers connecting the items, and from the first node (head) to the last node, each node can be visited (tail). As opposed to arrays, which require all elements to be shifted, linked lists just require altering the pointers of the adjacent nodes, making them helpful in situations ... Read More 
Updated on 21-Feb-2023 12:05:39
In Go programming language, a graph is a type of data structure made up of a limited number of nodes (also known as vertices) and a set of connecting edges. Relationships between several entities can be depicted on a graph. It can be represented by employing different data structures, such as an adjacency matrix or an adjacency list. The particular use case and the needs of the application will determine the data structure to be used. A graph can also be implemented in Go by using a library or package like go-graph. We will use two methods here to implement ... Read More 
Updated on 20-Feb-2023 16:17:00
In Go Programming language, a linked list is a data structure which contains a node that further contains two values, the data and the next, where next points to the next node in the list. We will use two methods in this program to access elements from a linked list. In the first example iteration will be used and in the second example a variable current will be used to access the elements. Method 1: Using Iteration This program builds a linked list with three members and iterates through it to access and output each element's value. The output ... Read More 
Updated on 20-Feb-2023 16:16:13
In Go, a linked list is a linear data structure with pointers connecting the items, and from the first node (head) to the last node, each node can be visited (tail). We will execute the program of removing elements from the linked list using two examples. The first example uses node struct whereas the second example uses a dummy node Method 1: Using Node Struct This code creates a Node struct that has two fields: Value and Next, which links to the next node in the list. The remove_node method removes the node with the supplied value from the list ... Read More Advertisements