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
Server Side Programming Articles - Page 288 of 2650
6K+ Views
Golang is a powerful programming language that provides a variety of features to work with structured data. One of these features is the ability to use structs as keys in maps. In this article, we will explore how to write a Golang program that uses structs as map keys. What is a Struct? In Golang, a struct is a composite data type that groups together zero or more values of various types. Structs are used to create more complex data types that can represent a range of objects. A struct is defined using the type and struct keywords, followed by ... Read More
1K+ Views
Golang is a popular programming language that offers a range of powerful features. One of these features is the ability to use the switch statement with a string type variable. In this article, we will explore how to write a Golang program that uses a string switch statement. What is a String Switch? In Golang, the switch statement can be used to test a variable against a list of values. A string switch statement is a type of switch statement that is specifically designed to work with string variables. A string switch statement works by comparing the value of a ... Read More
817 Views
Golang is a powerful programming language that offers a range of features and tools for building efficient and reliable applications. One such feature is the ability to use named return values and defaults in functions. In this article, we will discuss how to use named return values and defaults in Golang and why this feature is useful. What are Named Return Values and Defaults in Golang? In Golang, you can define named return values in a function signature, which can help make your code more readable and maintainable. Named return values allow you to define the names and types of ... Read More
462 Views
Golang is a powerful programming language that offers a range of features and tools for building efficient and reliable applications. One such feature is the ability to define functions with variable argument lists. In this article, we will discuss how to use functions with variable argument lists in Golang and why this feature is useful. What are Functions with Variable Argument Lists in Golang? In programming, a function with a variable argument list is a function that takes an unknown number of parameters or inputs. These inputs can be of any data type, including integers, strings, or even other functions. ... Read More
706 Views
Golang is a powerful programming language that offers a range of features and tools for building efficient and reliable applications. One such feature is the ability to define functions with multiple arguments. In this article, we will discuss how to use functions with two arguments in Golang and why this feature is useful. What are Functions with Two Arguments in Golang? In programming, a function is a set of instructions that performs a specific task. A function with two arguments, as the name suggests, is a function that takes two parameters or inputs. These inputs can be of any data ... Read More
370 Views
Golang is a popular programming language that offers a range of features and tools for building efficient and reliable applications. One such feature is the ability to use functions as local variables. In this article, we will discuss how to use functions as local variables in Golang and why this feature is useful. What are Local Variables in Golang? Before we dive into how to use functions as local variables in Golang, let's first understand what local variables are. In programming, a local variable is a variable that is defined within a function or block of code. Local variables are ... Read More
3K+ Views
Golang is a powerful programming language that has gained a lot of popularity in recent years. It offers many features and tools that make it easier for developers to create efficient and reliable applications. One of the features that sets Golang apart from other programming languages is the fallthrough keyword. In this article, we will take a look at how you can use the fallthrough keyword in your Golang programs. What is the Fallthrough Keyword in Golang? In Golang, the fallthrough keyword is used in switch statements to transfer control to the next case statement. When a case statement contains ... Read More
295 Views
In Go, the switch statement can also be used with floating-point numbers. This feature can be useful in certain scenarios, where a floating-point value needs to be compared against different thresholds or ranges. In this article, we will go through an example program that demonstrates the use of switch statement on floating-point numbers. Syntax of Switch Statement with Float The syntax of switch statement with floating-point numbers is the same as that with any other type. The only difference is that the cases need to be specified as floating-point values. switch expression { case value1: ... Read More
156 Views
When working with slices in Golang, it's common to need to remove duplicate elements from the slice. While there are many ways to do this, one approach that can be particularly useful is to remove duplicates while ignoring the order of the elements. This can be useful, for example, when you want to compare two slices for equality without caring about the order of the elements. In this article, we'll explore a simple Golang program that removes duplicates from a slice while ignoring the order of the elements. We'll break down the program step by step to explain how it ... Read More
198 Views
Removing duplicates from a slice or an array is a common problem in programming. One of the ways to solve this problem in Golang is by using nested loops. In this article, we will write a Golang program that removes duplicates from a slice using nested loops. Understanding the Problem Before writing the program, let's understand the problem statement. Suppose we have a slice with some duplicate elements − numbers := []int{1, 2, 3, 1, 4, 2, 5} Our task is to remove the duplicate elements from this slice and get the unique elements. The final slice should look ... Read More