Image for post
Image for post

What Is nil in Go

Using nil as Zero Values

Using nil in Comparison

Two nil Values of Two Different Types Are Not Comparable

Two nil Values of The Same Type May Not Be Comparable

Two nil Values of The Same Type Can Be Comparable Only When This Type Supports Comparision

Be Careful in nil Comparison When Interface Values Are Involved

Summary

A software engineer

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