Initializing Struct References

Use &T{} instead of new(T) when initializing struct references so that itis consistent with the struct initialization.

BadGood
  1. sval := T{Name: "foo"}
  2.  
  3. // inconsistent
  4. sptr := new(T)
  5. sptr.Name = "bar"
  1. sval := T{Name: "foo"}
  2.  
  3. sptr := &T{Name: "bar"}