Sabid Ansari has Published 150 Articles

How to Remove Duplicate Values from Slice in Golang?

Sabid Ansari

Sabid Ansari

Updated on 25-Apr-2023 09:47:11

7K+ Views

In Golang, a slice is a dynamically-sized array that can store a collection of elements of the same type. Sometimes, you may need to remove duplicate values from a slice to ensure that each element in the slice is unique. In this article, we'll discuss how to remove duplicate values ... Read More

How to Print Specific date-time in Golang?

Sabid Ansari

Sabid Ansari

Updated on 25-Apr-2023 09:37:42

2K+ Views

Go is a programming language that is well-suited for building high-performance, concurrent applications. One of the essential features of any application is the ability to work with date and time. In this article, we will explore how to print specific date-time in Go using the time package. Using the Time ... Read More

Go vs Java

Sabid Ansari

Sabid Ansari

Updated on 18-Apr-2023 13:03:29

404 Views

Go and Java are two popular programming languages used for developing different types of applications. While both languages have their unique features and advantages, there are some key differences between them that developers should consider when deciding which language to use for their projects. In this article, we'll explore the ... Read More

Generate UUID in Golang

Sabid Ansari

Sabid Ansari

Updated on 18-Apr-2023 11:34:34

3K+ Views

Universally Unique Identifier (UUID) is a 128-bit value that is used to uniquely identify objects or entities. UUID is widely used in computer systems for generating unique IDs for objects, documents, and data records. In Golang, we can generate UUID using the "github.com/google/uuid" package. Installing the "github.com/google/uuid" Package Before we ... Read More

Getting the current date and time with timestamp in local and other timezones in Golang

Sabid Ansari

Sabid Ansari

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

2K+ Views

In Go, it's easy to work with dates and times using the time package. This package provides a set of functions and types for working with dates and times, including the ability to get the current date and time with a timestamp in local and other timezones. In this article, ... Read More

Splitting a slice of bytes after the specified separator in Golang

Sabid Ansari

Sabid Ansari

Updated on 18-Apr-2023 10:40:46

535 Views

In Golang, it is often required to split a slice of bytes after a specific separator. This can be done using the built-in function bytes.SplitAfter(). This function splits a slice of bytes into sub-slices after each occurrence of a specified separator. In this article, we will discuss how to split ... Read More

Searching an element of int type in slice of ints in Golang

Sabid Ansari

Sabid Ansari

Updated on 18-Apr-2023 10:13:22

281 Views

Slices are an essential feature of Go programming language that allows you to store and manipulate an ordered collection of elements. Slices are similar to arrays, but unlike arrays, they are dynamic and can be resized. In Go, you can perform a search operation on a slice to find an ... Read More

Replacing all String which Matches with Regular Expression in Golang

Sabid Ansari

Sabid Ansari

Updated on 18-Apr-2023 10:12:34

6K+ Views

In Golang, you can replace all the string occurrences that match a regular expression with the help of the regexp package. The regexp package in Golang provides a ReplaceAllString() function that replaces all occurrences of the matched string with a new string. Example Here's an example of how to replace ... Read More

Polymorphism Using Interfaces in Golang

Sabid Ansari

Sabid Ansari

Updated on 18-Apr-2023 10:11:43

3K+ Views

Polymorphism is a powerful concept in object-oriented programming that allows you to write flexible and reusable code. In Go, you can achieve polymorphism using interfaces.  An interface is a collection of method signatures that any type can implement. This means that you can write code that can work with any ... Read More

How to find the index of rune in the string in Golang?

Sabid Ansari

Sabid Ansari

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

1K+ Views

Golang offers many built-in functions and packages to perform string operations. One common operation is finding the index of a particular rune in the string. In this article, we will explore how to find the index of a rune in a string in Golang. Rune in Golang is an alias ... Read More

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