structure: improve doc for IsValid()

This commit is contained in:
Fatih Arslan 2014-07-28 01:23:45 +03:00
parent c36b654328
commit 518752a838

View File

@ -74,9 +74,14 @@ func ToSlice(s interface{}) []interface{} {
}
// IsValid returns true if all fields in a struct are initialized (non zero
// value). A struct tag with the content of `structure:"-"` omits the checking
// of field. Note that only exported fields of a struct can be accessed, non
// exported fields will be neglected. It panics if s's kind is not struct.
// value). A struct tag with the content of "-" ignores the checking of that
// particular field. Example:
//
// // Field is ignored by this package.
// Field bool `structure:"-"`
//
// Note that only exported fields of a struct can be accessed, non exported
// fields will be neglected. It panics if s's kind is not struct.
func IsValid(s interface{}) bool {
v := reflect.ValueOf(s)