
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 26504 Articles for Server Side Programming

1K+ Views
In many applications, it is important to count the number of times a word appears in a string. This can be useful for generating word frequency counts, analyzing text data, and many other tasks. In this article, we will explore how to count the number of repeating words in a Golang string. Step 1: Convert the String to an Array of Words The first step in counting repeating words is to convert the string into an array of words. This can be done using the strings.Split() function, which splits a string into an array of substrings based on a separator. ... Read More

240 Views
In Golang, copying the sign of a given number is a common operation that may be needed in certain scenarios. For example, when performing arithmetic operations on numbers, it may be necessary to ensure that the sign of the result matches the sign of one of the operands. In this article, we will explore how to copy the sign of a given number in Golang, and discuss some use cases where this operation might be useful. Copying the Sign of a Given Number in Golang To copy the sign of a given number in Golang, we can use the math.Copysign() ... Read More

4K+ Views
In Golang, arrays are fixed-size data structures that hold a collection of values of the same type. In some cases, it may be necessary to copy an array to another array either by value or by reference. In this article, we will explore how to copy an array in Golang both by value and by reference. Copying an Array by Value in Golang In Golang, when you assign an array to another variable or pass it as a parameter to a function, it is copied by value. This means that any changes made to the copied array will not affect ... Read More

475 Views
Converting a string variable into Boolean, Integer, or Float type is a common requirement in Golang programming. Golang provides built-in functions that can be used for this purpose. In this article, we will explore how to convert a string variable into a Boolean, Integer, or Float type in Golang. Converting a String to a Boolean in Golang To convert a string variable into a Boolean type, we can use the strconv.ParseBool() function. The ParseBool() function returns two values - the Boolean value and an error. The following code demonstrates how to convert a string variable into a Boolean type − ... Read More

864 Views
Data compression is a process of reducing the size of data in order to save space or transmit data faster. Golang provides several libraries for compressing and decompressing data. In this article, we will discuss how to compress a file in Golang using the "compress/gzip" package. What is gzip Compression? gzip is a file format and a software application used for file compression and decompression. It is based on the DEFLATE algorithm, which is a combination of LZ77 and Huffman coding. gzip compresses a file into a smaller size, making it easier to store and transmit over the network. Compressing ... Read More

6K+ Views
Composition is a powerful concept in object-oriented programming that allows creating complex types by combining smaller, simpler types. It enables building new types that have the functionality of several existing types, without the need to inherit from them. In Go, composition is achieved using struct embedding, a language feature that allows embedding one struct type inside another. In this article, we will explore how composition works in Go and how it can be used to create more flexible and modular programs. What is Composition? Composition is a mechanism that enables combining simpler types to create more complex ones. It is ... Read More

2K+ Views
Pointers are one of the most important concepts in Golang. They are used to reference a memory location and are frequently used in programming to improve performance and memory usage. In Golang, pointers are represented by an asterisk (*) followed by the type of the variable being pointed to. Comparing pointers in Golang can be tricky and requires a good understanding of the underlying concepts. In this article, we will explore the different ways to compare pointers in Golang. Comparing Pointers using == Operator In Golang, the == operator can be used to compare pointers. When using the == operator, ... Read More

4K+ Views
Maps in Golang are unordered collections of key-value pairs. They are widely used in Golang programming due to their flexibility and ease of use. In many cases, it may be necessary to compare maps to check if they are equal or not. In this article, we will explore the different methods of comparing maps in Golang. Method 1: Looping Through the Maps One of the simplest methods to compare two maps is by looping through them and comparing each key-value pair. Here is an example − Example package main import "fmt" func CompareMaps(map1, map2 map[string]int) bool { ... Read More

3K+ Views
In Golang, printing messages to the console is a common task for debugging and logging purposes. There are two main ways to print messages to the console: using Println and Printf. In this article, we will compare these two methods and explore when it is appropriate to use each one. Println Println is a built-in function in Golang's fmt package that is used to print messages to the console with a new line at the end. It takes zero or more arguments of any type and separates them with a space. Here is an example − Example package main ... Read More

2K+ Views
Conditional statements in programming are used to execute different sets of instructions based on a condition. In Golang, we have two types of conditional statements, if and switch. In this article, we will focus on how to combine conditional statements in Golang. Combining conditional statements in Golang allows us to perform more complex checks and execute specific blocks of code based on multiple conditions. There are three ways to combine conditional statements in Golang: nested if statements, logical operators, and switch statements. Nested If Statements Nested if statements are used to check multiple conditions in a hierarchical manner. The inner ... Read More