Golang template and testing for Valid fields
In Go's database/sql package, there are a bunch of Null[Type] structs that help map database values (and their possible nulls) into code. I'm trying to figure out how to test whether a struct field is null, or in other words, when its Valid property is false. The recommended way to print a SQL field is to use the .Value property, like this: <div>{{ .MyStruct.MyField.Value }}</div> This works great. But suppose I have something slightly more complicated, where I need to test the value against something else, for example: <select name="y"> {{ range .SomeSlice }} <option value="{{ . }}" {{ if eq