Siva Sai has Published 279 Articles

How to Assign Default Value for Struct Field in Golang?

Siva Sai

Siva Sai

Updated on 19-Apr-2023 09:58:18

15K+ Views

In Golang, it is common to have struct types that need to be initialized with default values. In this article, we will explore how to assign a default value for a struct field in Golang. Assigning Default Values for Struct Fields To assign a default value for a struct field ... Read More

How to append a slice in Golang?

Siva Sai

Siva Sai

Updated on 19-Apr-2023 09:56:45

4K+ Views

Appending a slice in Golang is a common operation when working with collections of data. In this article, we will explore how to append a slice in Golang. Syntax for Appending a Slice in Golang slice = append(slice, element) The append() function in Golang appends the given element(s) to ... Read More

How Many Logical Processors Used By Current Process in Golang

Siva Sai

Siva Sai

Updated on 19-Apr-2023 09:55:31

306 Views

In modern computing, multi-core processors are ubiquitous, which can execute multiple tasks simultaneously. In Golang, we can take advantage of this by using concurrency to perform tasks in parallel. However, how can we determine the number of logical processors used by the current process? In this article, we will discuss ... Read More

Higher-Order Function in Golang

Siva Sai

Siva Sai

Updated on 19-Apr-2023 09:53:59

823 Views

Higher-order functions are a powerful feature of modern programming languages, including Golang. In this article, we will discuss what higher-order functions are and how they can be used in Golang. What is a Higher-Order Function? A higher-order function is a function that takes one or more functions as arguments and/or ... Read More

Goroutines – Concurrency in Golang

Siva Sai

Siva Sai

Updated on 19-Apr-2023 09:51:46

257 Views

Golang, also known as Go, is a programming language that was designed to be efficient and scalable for modern computing needs. One of its most powerful features is the ability to handle concurrency through the use of Goroutines. In this article, we will discuss what Goroutines are and how they ... Read More

Golang Program to Count Trailing Zeros in Factorial of a Number

Siva Sai

Siva Sai

Updated on 19-Apr-2023 09:47:46

130 Views

In mathematics, factorial is a function that multiplies a given number by every positive integer less than or equal to that number. The result of this function is denoted by the symbol !. For example, the factorial of 5 is 5! = 5 x 4 x 3 x 2 x ... Read More

Golang Program to Check if the String is Alphanumeric

Siva Sai

Siva Sai

Updated on 19-Apr-2023 09:44:35

1K+ Views

In Go programming language, it is essential to check if a string contains alphanumeric characters or not. Alphanumeric characters are a combination of alphabets and numbers, and they are commonly used in passwords, usernames, and other important data. In this article, we will discuss how to write a Golang program ... Read More

Golang program that removes duplicates, ignores order

Siva Sai

Siva Sai

Updated on 18-Apr-2023 12:55:53

63 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 ... Read More

Golang program that uses switch, multiple value cases

Siva Sai

Siva Sai

Updated on 18-Apr-2023 10:52:55

4K+ Views

Switch statements in Golang provide an elegant and concise way to control the flow of execution based on the value of a variable. In addition to the basic switch statement, Golang also provides the ability to have multiple values in a case statement. In this article, we will explore how ... Read More

Golang program that uses structs as map keys

Siva Sai

Siva Sai

Updated on 18-Apr-2023 10:52:15

4K+ 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 ... Read More

Advertisements