tenntenn/gova — pull request #2 by superduper (2014-03-28 07:08:42+00:00)
Title: Fix type reflection for pointer values

Addressing this issue:
```go
package main

import (
"github.com/tenntenn/gova"
)

type TRegistrationForm struct {
Firstname string `pattern:"([A-Z][a-z])+" json:"firstname"`
Lastname string `pattern:"([A-Z][a-z])+" json:"lastname"`
Email string `email:"-" json:"email"`
CellPhone string `pattern:"([A-Z][a-z])+" json:"cellphone"`
Password string `pattern:"([A-Z][a-z])+" json:"password"`
ZIP string `pattern:"([A-Z][a-z])+" json:"zip"`
DOB string `pattern:"([A-Z][a-z])+" json:"dob"`
}

func RegistrationForm(firstName, lastName, email, cellPhone, password, zip, dob string) (*TRegistrationForm, error) {
tmp := &TRegistrationForm{firstName, lastName, email, cellPhone, password, zip, dob}
validationErr := gova.Validate(tmp)
if validationErr != nil {
return nil, validationErr
} else {
return tmp, nil
}
}

func main(){
nothing := ""
email := "john@smith.com"
cellPhone := "1-800-APPL"
zip := "90210"
dob := "03/12/1988"
firstName := "John"
lastName := "Smith"
RegistrationForm(firstName, lastName, email, cellPhone, nothing, zip, dob)
}
```
Panics with
```
panic: reflect: Field of non-struct type

goroutine 1 [running]:
runtime.panic(0xabd60, 0x21028f1f0)
/usr/local/Cellar/go/1.2/libexec/src/pkg/runtime/panic.c:266 +0xb6
reflect.(*rtype).Field(0xa39a0, 0x0, 0x196, 0x0, 0xabd60, ...)
/usr/local/Cellar/go/1.2/libexec/src/pkg/reflect/type.go:598 +0x7d
github.com/tenntenn/gova.Validate(0xa39a0, 0x2102ce8c0, 0x2102bd360, 0xeb100)
/Users/superduper/Development/go/src/github.com/tenntenn/gova/validator.go:56 +0x2e9
main.RegistrationForm(0xe7620, 0x4, 0xe89e0, 0x5, 0xf1eb0, ...)
/Users/superduper/example.go:18 +0xd1
main.main()
/Users/superduper/example.go:34 +0xe4
exit status 2
```