What’s a pointer ?

In Go , A pointer is a variable whose value is a memory address.

A pointer is defined using the ampersand operator.

Following a Pointer

In order to access ie following the pointer value , Go uses the asterisk operator.

--

--

It’s illegal in go to define a variable and not use it.Go will throw unused variable error.

However , there are situations when we need to define variable but not necessary use it , such as using one return value of a function over another.

In such situation , Go provides a solution called blank identifier.

A blank identifier is the use of single underscore operator( _ )

--

--