Golang vs Python: The Ultimate Battle in DevOps
In the world of DevOps, two programming languages are often pitted against each other: Golang and Python. Both languages have their own strengths and …
Read Article →104 articles about go development, tools, and best practices
In the world of DevOps, two programming languages are often pitted against each other: Golang and Python. Both languages have their own strengths and …
Read Article →Master Go’s synchronization primitives including mutexes.
#Go’s sync package contains the building blocks for safe concurrent programming. …
Read Article →In today’s digital age, password security is more important than ever before. Hackers can easily guess weak passwords, leading to …
Read Article →If you need to convert Time to a String in Go, then you can do one of the following:
time.Nowpackage main
import ( …
Read Article →
To perform a Deep Copy in Go, you can use a struct type as follows:
struct in Gopackage main
import (
"fmt"
)
type …
Read Article →
Go doesn’t typically have Lambda Expressions, but synonymous to Lambdas, or Closures if Anonymous Functions for Go.
If you would like to create an empty slice in Go, then you can do the following:
package main
import …
Read Article →
If you get a timeout when trying to install go dependencies, the error may look something like this:
$ go get github.com/aws/aws-sdk-go/aws
go: …
Read Article →
If you need to join two (2) strings together in Golang, you can do the following, using the + concatenation operator:
package main
import ( …
Read Article →
If you want to execute Linux commands in Golang, you can use exec.Command from the os/exec package:
cmd := exec.Command("echo", "hello …If you need to check for Prime Numbers in Golang, then you can use the following method:
const n = 1212121
if big.NewInt(n).ProbablyPrime(0) { …
Read Article →
If you need to raise a number to a power in Golang, then you can use the math.Pow function:
package main
import (
"math"
)
func …
Read Article →
Given the triangle of consecutive odd numbers:
1
3 5
7 9 11
13 15 17 19
21 23 …
Read Article →
If you need to SHA256 a String in Go, then you can use the crypto/sha256 package.
package main
import ( …
Read Article →
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! …
Read Article →You will be given an array of integers whose elements have both a negative and a positive value, except for one integer that is either …
Read Article →You will have a list of rationals in the form:
lst = [ [numer_1, denom_1] , ... , [numer_n, denom_n] ]
where all numbers are positive …
Read Article →We have been searching for all the neighboring points in a Cartesian coordinate system. As we know each point in a coordinate system has …
Read Article →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 …
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 > 0) such …
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 Article →You will be given an integer array and your task is to return the sum of elements occupying prime-numbered indices.
The first element of …
Read Article →What is your favourite day of the week? Check if it’s the most frequent day of the week in the year.
You are given a year as …
Read Article →In this challenge, you will be given a string with brackets and an index of an opening bracket and your task will be to return the index …
Read Article →