Useful Techniques in Go
  type T struct {
      Foo string
      Bar int
      Qux string
  }
  
  t := T{"example", 123} // doesn't compile
  t := T{Foo: "example", Bar: 123} // OK

I find this behavior somewhat surprising. Contrary to the author's claim, I would expect both to fail to compile.Reading the Go specification, it seems to be a valid behavior.> An element list that contains keys does not need to have an element for each struct field. Omitted fields get the zero value for that field.[1]I understand zeroing out the "unused" fields is common in low level programming, but Go's behavior in this specific case feels a bit too implicit for my taste.[1] https://golang.org/ref/spec