Sabid Ansari has Published 150 Articles

Goroutine vs Thread in Golang

Sabid Ansari

Sabid Ansari

Updated on 18-Apr-2023 10:10:08

8K+ Views

Goroutines and threads are both used for achieving concurrency in programming languages. In Golang, goroutines are the primary mechanism for achieving concurrency, while threads are a lower-level construct that is managed by the operating system. In this article, we will explore the differences between goroutines and threads in Golang, their ... Read More

Golang GOPATH and GOROOT

Sabid Ansari

Sabid Ansari

Updated on 18-Apr-2023 10:09:01

8K+ Views

If you are new to Golang, you may have heard of the terms GOPATH and GOROOT. These are important concepts that every Golang developer should understand. In this article, we will discuss what GOPATH and GOROOT are and how to use them effectively. What is GOPATH? GOPATH is an environment ... Read More

Golang Environment Variables

Sabid Ansari

Sabid Ansari

Updated on 18-Apr-2023 10:08:37

989 Views

Environment variables are an essential part of any software development process. They provide a way to configure an application's behavior without hard-coding values into the code. In Golang, environment variables are straightforward to use and can be set in many ways. In this article, we will discuss how to use ... Read More

Go Decision Making (if, if-else, Nested-if, if-else-if)

Sabid Ansari

Sabid Ansari

Updated on 18-Apr-2023 10:03:28

462 Views

Decision making is an important aspect of programming, and Go provides a variety of constructs for making decisions in your code. In this article, we'll explore the different types of decision making constructs in Go, including the if, if-else, nested-if, and if-else-if constructs. if statement The if statement in Go ... Read More

Generating Random Numbers in Golang

Sabid Ansari

Sabid Ansari

Updated on 18-Apr-2023 09:31:37

2K+ Views

Random numbers play an important role in many applications, from computer games to cryptography. Go has a built-in package called "math/rand" that provides a suite of functions to generate random numbers. In this article, we will explore how to use the "math/rand" package to generate random numbers in Go. Generating ... Read More

Function that takes an interface type as value and pointer in Golang

Sabid Ansari

Sabid Ansari

Updated on 18-Apr-2023 09:29:04

2K+ Views

In Go, it is common to write functions that take interfaces as arguments or pointers to interfaces. This can be useful when you want to write generic code that works with any type that satisfies a particular interface. Functions That Take an Interface Type as Value In Go, interfaces are ... Read More

Flag.Bool() Function in Golang With Examples

Sabid Ansari

Sabid Ansari

Updated on 18-Apr-2023 09:20:20

1K+ Views

In Golang, the flag package provides a way to parse command-line arguments. It allows us to define flags that can be set when running a program from the command line. The flag.Bool() function is used to define a boolean flag. It creates a new bool flag with the specified name, ... Read More

Finding the Inverse Hyperbolic Tangent of Specified Number in Golang

Sabid Ansari

Sabid Ansari

Updated on 17-Apr-2023 14:12:34

200 Views

In Golang, the math/cmplx package provides functions to calculate various mathematical operations on complex numbers. The inverse hyperbolic tangent function, also known as arctanh, is one of the many functions provided by the package. Inverse hyperbolic tangent function is used to find the angle whose hyperbolic tangent is a given ... Read More

Finding the Square Root of the Complex Number in Golang

Sabid Ansari

Sabid Ansari

Updated on 17-Apr-2023 12:54:15

533 Views

In mathematics, a square root of a number is a value that when multiplied by itself, gives the original number. In Golang, the math/cmplx package provides built-in functions to find the square root of a complex number. In this article, we will discuss how to find the square root of ... Read More

Finding Index of the Regular Expression present in Slice of Golang

Sabid Ansari

Sabid Ansari

Updated on 17-Apr-2023 12:39:00

200 Views

In Golang, you can use regular expressions to search for a pattern in a string. The regexp package provides functionality to work with regular expressions. In this tutorial, we will learn how to find the index of the regular expression present in the slice of Golang. Step 1: Importing the ... Read More

Previous 1 ... 5 6 7 8 9 ... 15 Next
Advertisements