|
|
|
|
|
by toufka
3979 days ago
|
|
This is the one problem. Spent a whole day trying to figure out why only the first tag in the struct was 'active': Name string `xml:"name", db:"name"` //<--- XML works, DB doesn't
Name string `db:"name", xml:"name"` //<--- DB works, XML doesn't
The answer was, going from memory, I added a comma (,) between the tags. Should have been: Name string `xml:"name" db:"name"`
Stupid simple mistake, but really hard to track down. There was no compiler error, the second tag failed silently, and the first tag worked, so it was really hard to find the bad code.That along with my favorite: quote-wars. Many-a-time did I forget the quotes on the tag itself only to have it fail (without warning again...): Name string `xml:name db:"name"` //<--- DB works, XML doesn't
|
|
http://godoc.org/golang.org/x/tools/cmd/vet