Let’s start with quiz comparing two programs which differ only by single statement. Program C uses constant declaration (source code):
type N int
func main() { const c = 1 var n N = c fmt.Println(n)}
Deferred function is declared inside another function and is called when surrounding function exits…
In contrast to many other languages, Go doesn’t have multiple constructs for…
(source code)
package main
import ( "fmt")
type T struct { id int}
func main() { t1 := T{id: 1} t2 := T{id: 2} ts1 :=…
Declaration of struct fields can be enriched by string literal placed afterwards — tag. Tags add meta information used either by…