If it won't be simple, it simply won't be. [Hire me, source code] by Miki Tebeka, CEO, 353Solutions
Sunday, September 24, 2017
Thursday, September 14, 2017
Checking for Zero Values in Go
In Go, every type has a zero value. Which is the value a variable of this type get if it's not initialized. I had a configuration object of type map[string]interface{} and I needed to check if value exists and is not a zero value.
Here's a small piece of code that checks for zero values:
Here's a small piece of code that checks for zero values:
Labels:
go,
reflection
Subscribe to:
Posts (Atom)