Learn Concurrency in Go

July 22, 2024

Concurrency in Go is one of its most powerful features, designed to make it easy to write concurrent programs.


Read More

Learn Go as a DevOps Engineer

July 18, 2024

Go, also known as Golang, is an open-source programming language designed for simplicity, efficiency, and reliability.


Read More

Developing a Custom Kubernetes Controller in Go

June 20, 2024

A custom Kubernetes controller manages custom resources within a Kubernetes cluster, allowing for extended functionalities and custom automation.


Read More

Creating a Monitoring Agent in Go

June 18, 2024

Building a monitoring agent involves collecting metrics from a system and sending them to a monitoring server or displaying them on a dashboard.


Read More

Building a CI/CD Pipeline Tool in Go

June 15, 2024

Developing a custom CI/CD pipeline tool in Go can help automate the processes of building, testing, and deploying applications.


Read More

Golang vs Python: The Ultimate Battle in DevOps

May 27, 2023

In the world of DevOps, two programming languages are often pitted against each other: Golang and Python.


Read More

How to Create a Password Generator in Golang

April 2, 2023

Introduction In today’s digital age, password security is more important than ever before.


Read More

How to Convert Time to String in Golang

October 6, 2022

If you need to convert Time to a String in Go, then you can do one of the following:


Read More

How to Perform a Deep Copy in Golang

October 5, 2022

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


Read More

How to Return Lambda Functions in Golang

October 4, 2022

Go doesn’t typically have Lambda Expressions, but synonymous to Lambdas, or Closures if Anonymous Functions for Go.


Read More

How to Create an Empty Slice in Golang

October 3, 2022

If you would like to create an empty slice in Go, then you can do the following:


Read More

[Solved] dial tcp: lookup proxy.golang.org: i/o timeout

September 25, 2022

If you get a timeout when trying to install go dependencies, the error may look something like this:


Read More

How to Execute Linux Commands in Golang

July 4, 2022

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


Read More

How to Check for Prime Numbers using Golang

July 3, 2022

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


Read More

How to Raise a Number to a Power in Golang

July 2, 2022

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


Read More

How to Calculate the Sum of the Numbers in the Nth row of a Triangle in Golang

May 24, 2022

The challenge Given the triangle of consecutive odd numbers: 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 .


Read More

How to SHA256 a String in Golang

May 18, 2022

If you need to SHA256 a String in Go, then you can use the crypto/sha256 package.


Read More

How to Base64 Encode/Decode in Golang

May 17, 2022

Go ships with an encoding/base64 package that allows for encode and decoding of Base64 strings.


Read More

How to perform Array Element Parity in Golang

May 14, 2022

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 is either only negative or only positive.


Read More

Irreducible Sum of Rationals in Golang

April 29, 2022

The challenge You will have a list of rationals in the form:


Read More

Calculating Cartesian Neighbors Distance in Golang

March 25, 2022

The challenge We have been searching for all the neighboring points in a Cartesian coordinate system.


Read More

How to Calculate Dominant Primes in Golang

March 24, 2022

The challenge The prime number sequence starts with: 2,3,5,7,11,13,17,19.... Notice that 2 is in position one.


Read More

How to Solve Simple Square Numbers in Golang

March 22, 2022

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 > 0) such that n + N is also a perfect square.


Read More

How to perform Function Iteration in Golang

March 21, 2022

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 number of times.


Read More

How to Find the Sum of Prime-Indexed Elements in Go

March 9, 2022

The challenge You will be given an integer array and your task is to return the sum of elements occupying prime-numbered indices.


Read More

Calculate the Most Frequent Weekdays in Go

March 7, 2022

The challenge What is your favourite day of the week? Check if it’s the most frequent day of the week in the year.


Read More

Return Index of Matching Closing Bracket in Go

March 6, 2022

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 to return the index of the matching closing bracket.


Read More

How to Sum the Average for NBA Players in Golang

January 24, 2022

The challenge Write a function, called sumPPG, that takes two NBA player objects/struct/Hash/Dict/Class and sums their PPG


Read More

How to Compute a Cube as Sums in Golang

January 23, 2022

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 create a Coordinates Validator in Golang

January 9, 2022

The challenge You need to create a function that will validate if given parameters are valid geographical coordinates.


Read More

How to Validate ISBN-10 numbers in Golang

January 8, 2022

The challenge ISBN-10 identifiers are ten digits long. The first nine characters are digits 0-9.


Read More

How to Replace Noun Phrases with Pronouns in Golang

December 28, 2021

The challenge A Noun Phrase is a phrase that can be replaced by a pronoun [he/she/it].


Read More

Maximum Positive Integer Rotations in Golang

December 27, 2021

The challenge Write function MaxRot(n) which given a positive integer n returns the maximum number you got doing rotations similar to the above example.


Read More

How to Find the Sum of Angles in Golang

December 23, 2021

The challenge Find the total sum of internal angles (in degrees) in an n-sided simple polygon.


Read More

How to Stop a Goroutine in Golang

December 17, 2021

It’s possible to stop a Goroutine by sending a value into it via a signal channel:


Read More

Highest Rank Number in an Array in Golang

November 29, 2021

The challenge Complete the method which returns the number which is most frequent in the given input array.


Read More

How to Reverse Sort Integers in Go

November 19, 2021

The challenge The two oldest ages function/method needs to be completed.


Read More

How to Reimplement the Unix Uniq Command in Golang

November 15, 2021

The challenge Implement a function which behaves like the uniq command in UNIX.


Read More

How to check if a string is empty in Go

November 10, 2021

If you need to check if a string is empty in Go, then there are two possible ways to immediately verify this:


Read More

How to read a file line by line in Go

November 9, 2021

If you need to read a file line by line in Go, then you can use the bufio package as follows:


Read More

Floating-point Approximation in Golang

November 8, 2021

The challenge Consider the function f: x -> sqrt(1 + x) - 1 at x = 1e-15.


Read More

All the Ways to Divide an Array in Two in Golang

November 7, 2021

The challenge Write a function partlist that gives all the ways to divide an array of at least two elements into two non-empty parts.


Read More

How to check if a file exists in Go

November 6, 2021

If you need to check if a file exists using Go, then you can use one of the following methods, depending on the version of Go you may be using.


Read More

How to convert a string value to an int in Go

November 5, 2021

If you need to convert a string to an int in Go, then you should use the strconv.


Read More

How to convert an int value to string in Go

November 4, 2021

If you need to convert an int to a string in Go, then you should use the strconv.


Read More

How to Efficiently Concatenate Strings in Go

November 3, 2021

If you are using a version of Go >= 1.10, then you should be using the newer strings.


Read More

How to check if a map contains a key in Go

November 2, 2021

If you have a map in Go and want to only perform an action if it contains a certain key, then you can do so easily:


Read More

How to Loop Forever in Golang

October 31, 2021

If you need to loop forever, or infinitely, in your Go code, then you have 2 options:


Read More

Understanding For Loops in Golang

October 30, 2021

In Golang a for loop is a way to loop through an iterable.


Read More

[Solved] go mod init: modules disabled by GO111MODULE=off

October 29, 2021

You’ve probably just tried to initialise a new Go module, and received the following error:


Read More

How to UpperCase the start of each Word in a String in Golang

October 28, 2021

The challenge The task is to take a string of lower-cased words and convert the sentence to upper-case the first letter/character of each word


Read More

How to Find the Smallest Integer in the Array in Golang

October 26, 2021

The challenge Given an array of integers your solution should find the smallest integer.


Read More

Forming Unique Array Combinations in Golang

October 24, 2021

The challenge You are given an array of arrays and your task will be to return the number of unique arrays that can be formed by picking exactly one element from each subarray.


Read More

How to Sum all the Integers in a String in Golang

October 20, 2021

The challenge Implement a function that calculates the sum of the integers inside a string.


Read More

How to Reverse a String in Golang

October 19, 2021

The challenge Complete the solution so that it reverses the string passed into it.


Read More

How to Find the Last Digit of a Huge Number in Golang

October 15, 2021

The challenge For a given list [x1, x2, x3, ..., xn] compute the last (decimal) digit of x1 ^ (x2 ^ (x3 ^ (.


Read More

How to Circularly Sort an Array in Golang

October 13, 2021

The challenge An array is circularly sorted if the elements are sorted in ascending order but displaced, or rotated, by any number of steps.


Read More

How to Alternate String Casing in Golang

October 11, 2021

The challenge Write a function toWeirdCase (weirdcase in Ruby) that accepts a string, and returns the same string with all even indexed characters in each word uppercased, and all odd indexed characters in each word lowercased.


Read More

Roman Numerals Decoder in Golang

October 6, 2021

The challenge Create a function that takes a Roman numeral as its argument and returns its value as a numeric decimal integer.


Read More

How to Subtract from Time in Golang

October 5, 2021

The challenge Clock shows h hours, m minutes and s seconds after midnight.


Read More

Bit Counting in Golang

October 3, 2021

The challenge Write a function that takes an integer as input, and returns the number of bits that are equal to one in the binary representation of that number.


Read More

How to Find Next Higher Number with Same Bits in Golang

October 2, 2021

The challenge Find the next higher number (int) with same ‘1’- Bits.


Read More

How to Find the First Non-Repeating Character in Golang

October 1, 2021

The challenge Write a function named first_non_repeating_letter that takes a string input, and returns the first character that is not repeated anywhere in the string.


Read More

How to Find the Last Fibonacci Digit in Golang

September 30, 2021

The challenge Return the last digit of the nth element in the Fibonacci sequence (starting with 1,1, to be extra clear, not with 0,1 or other numbers).


Read More

How to Validate an IP Address in Golang

September 29, 2021

The challenge Write an algorithm that will identify valid IPv4 addresses in dot-decimal format.


Read More

Formatting Strings with Fmt in Golang

September 27, 2021

Fmt provides printing to standard output (usually the console) and formatting of strings capabilities.


Read More

How to Read from Standard Input in Golang

September 25, 2021

Reading from “standard input” is really useful if you are making a command-line application and require user input.


Read More

How to Install Golang on WSL/WSL2

September 24, 2021

If you need to install Golang on WSL under Windows 10 or higher, you can follow these few steps.


Read More

How to Repeat by String Index in Golang

August 20, 2021

The challenge Create a function that repeats each character by the amount of it’s index value of the original string.


Read More

Calculate the Third Angle of a Triangle in Go

August 18, 2021

The challenge You are given two interior angles (in degrees) of a triangle.


Read More

How to Detect if Numbers are in Order in Golang

June 27, 2021

The challenge In this challenge, your function receives an array of integers as input.


Read More

Alternate Capitalization in Golang

June 26, 2021

The challenge Given a string, capitalize the letters that occupy even indexes and odd indexes separately, and return as shown below.


Read More

Check if a String is Uppercase in Golang

June 25, 2021

The challenge Create a method IsUpperCase to see whether the string is ALL CAPS.


Read More

How to UpperCase a String in Golang

June 24, 2021

In Go, there are multiple ways to make a string UpperCase, each of them are by using the strings package.


Read More

Return the Shortest Words in Golang

June 23, 2021

The challenge Given a string of words, return the length of the shortest word(s).


Read More

Creating a Multiplication Table for a Number in Golang

June 21, 2021

The challenge Your goal is to return multiplication table for number that is always an integer from 1 to 10.


Read More

How to Remove Duplicates in an Array in Golang

June 20, 2021

The challenge Remove the left-most duplicates from a list of integers and return the result.


Read More

How to Dry Potatoes in Golang

June 19, 2021

The challenge All we eat is water and dry matter.


Read More

How to Reverse or Rotate in Golang

June 18, 2021

The challenge The input is a string str of digits. Cut the string into chunks (a chunk here is a substring of the initial string) of size sz (ignore the last chunk if its size is less than sz).


Read More

Get which Quarter of the Year in Golang

June 15, 2021

The challenge Given a month as an integer from 1 to 12, return to which quarter of the year it belongs as an integer number.


Read More

Introducing Variables in Golang

March 11, 2020

Golang comes with a decent offering around variables that you can use to store, retrieve and manipulate information.


Read More

Golang cannot convert (type string) to type int

March 10, 2020

Every language has it’s ways of converting data types. One of the most common data types to convert between is that of strings (string) and integers (int).


Read More

Learn Golang as a Python Developer

March 9, 2020

Learning Go or Golang as a Python developer, programmer or software engineer is easier than you think.


Read More