## How to Convert Time to String in Golang

If you need to convert Time to a String in Go, then you can do one of the following: Option 1 – Using time.Now Option… Read More »How to Convert Time to String in Golang

If you need to convert Time to a String in Go, then you can do one of the following: Option 1 – Using time.Now Option… Read More »How to Convert Time to String in Golang

To perform a Deep Copy in Go, you can use a struct type as follows: Deep Copying using a struct in Go

Go doesn’t typically have Lambda Expressions, but synonymous to Lambdas, or Closures if Anonymous Functions for Go. How to return a value from an Anonymous… Read More »How to Return Lambda Functions in Golang

If you would like to create an empty slice in Go, then you can do the following: Option 1 – Initialize an Empty Slice in… Read More »How to Create an Empty Slice in Golang

If you get a timeout when trying to install go dependencies, the error may look something like this: How to Solve the Timeout Issue when… Read More »[Solved] dial tcp: lookup proxy.golang.org: i/o timeout

If you want to execute linux commands in Golang, then you can use exec.Command:

If you need to check for Prime Numbers in Golang, then you can use the following method:

If you need to raise a number to a power in Golang, then you can use the math.Pow function:

The challenge Given the triangle of consecutive odd numbers: Calculate the sum of the numbers in the nth row of this triangle (starting at index 1)… Read More »How to Calculate the Sum of the Numbers in the Nth row of a Triangle in Golang

If you need to SHA256 a String in Go, then you can use the crypto/sha256 package. SHA256 a String in Go The output will look… Read More »How to SHA256 a String in Golang

Go ships with an encoding/base64 package that allows for encode and decoding of Base64 strings. Import the base64 package and then start using it! Base64… Read More »How to Base64 Encode/Decode in Golang

The challenge You will be given an array of integers whose elements have both a negative and a positive value, except for one integer that… Read More »How to perform Array Element Parity in Golang

The challenge You will have a list of rationals in the form: where all numbers are positive integers. You have to produce their sum N /… Read More »Irreducible Sum of Rationals in Golang

The challenge We have been searching for all the neighboring points in a Cartesian coordinate system. As we know each point in a coordinate system… Read More »Calculating Cartesian Neighbors Distance in Golang

The challenge The prime number sequence starts with: 2,3,5,7,11,13,17,19…. Notice that 2 is in position one. 3 occupies position two, which is a prime-numbered position. Similarly, 5, 11 and 17 also occupy prime-numbered positions. We shall… Read More »How to Calculate Dominant Primes in Golang

The challenge In this challenge, you will be given a number n (n > 0) and your task will be to return the smallest square number N (N >… Read More »How to Solve Simple Square Numbers in Golang

The challenge The purpose of this challenge is to write a higher-order function returning a new function that iterates on a specified function a given… Read More »How to perform Function Iteration in Golang

The challenge You will be given an integer array and your task is to return the sum of elements occupying prime-numbered indices. The first element… Read More »How to Find the Sum of Prime-Indexed Elements in Go

The challenge What is your favourite day of the week? Check if it’s the most frequent day of the week in the year. You are… Read More »Calculate the Most Frequent Weekdays in Go

The challenge In this challenge, you will be given a string with brackets and an index of an opening bracket and your task will be… Read More »Return Index of Matching Closing Bracket in Go

The challenge Write a function, called sumPPG, that takes two NBA player objects/struct/Hash/Dict/Class and sums their PPG Examples: The solution in Golang Option 1: Option 2:… Read More »How to Sum the Average for NBA Players in Golang

The challenge You will be given a number n (where n >= 1) and your task is to find n consecutive odd numbers whose sum is exactly the cube of n.… Read More »How to Compute a Cube as Sums in Golang

The challenge You need to create a function that will validate if given parameters are valid geographical coordinates. Valid coordinates look like the following: “23.32353342, -32.543534534”.… Read More »How to create a Coordinates Validator in Golang

The challenge ISBN-10 identifiers are ten digits long. The first nine characters are digits 0-9. The last digit can be 0-9 or X, to indicate a value of 10.… Read More »How to Validate ISBN-10 numbers in Golang

The challenge A Noun Phrase is a phrase that can be replaced by a pronoun [he/she/it]. For example, in the sentence: a girl ate the… Read More »How to Replace Noun Phrases with Pronouns in Golang