In Go, the loop iterator variable is a single variable that takes different values in each loop iteration. but when used wrong it leads to unintended behavior.

We are going to discuss two common mistakes.

Using reference to this variable:

We you use reference to the loop iterator variable, you will find that all values are the same because it references to just one variable address (the last updated one) For example:

func main() {var nums []*int

for i := 0; i < 3; i++ {
nums = append(nums, &i)
}
fmt.Println("Unexpected result")
fmt.Println(*nums[0], *nums[1], *nums[2])
}

It will…


Firstly, We have to agree that if you are a software engineer and you are about to decide which database you will choose for your new application it is essential to have a good understanding of the underlying storage engine to reason about how the database actually delivers

We are going to talk about storage engines that are used in both traditional relational databases and NOSQL databases.

We will talk about the two most popular of the storage engines log-structured storage engines, and page-oriented storage engines.

The main idea about the storage engines is how it stores and retrieves the…

Mohamed AbdEl Mohaimen

Talented software engineer looking always for new challenges, Problem solving and algorithms enthusiastic.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store