reflect.go
func isDefaultValue(rv reflect.Value) (erv reflect.Value, isDefaultValue bool) {
	rv, _, isNilPtr := derefPointers(rv)
	if isNilPtr {
		return rv, true
	} else {
		switch rv.Kind() {
		case reflect.Bool:
			return rv, rv.Bool() == false
		case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
			return rv, rv.Int() == 0
		case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
			return rv, rv.Uint() == 0
		case reflect.String:
			return rv, rv.Len() == 0
		case reflect.Chan, reflect.Map, reflect.Slice:
			return rv, rv.IsNil() || rv.Len() == 0
		case reflect.Func, reflect.Interface:
			return rv, rv.IsNil()
		default:
			return rv, false
		}
	}
}
func isDefaultValue(rv reflect.Value) (erv reflect.Value, isDefaultValue bool) {
	rv, _, isNilPtr := derefPointers(rv)
	if isNilPtr {
		return rv, true
	} else {
		switch rv.Kind() {
		case reflect.Bool:
			return rv, rv.Bool() == false
		case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
			return rv, rv.Int() == 0
		case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
			return rv, rv.Uint() == 0
		case reflect.String:
			return rv, rv.Len() == 0
		case reflect.Chan, reflect.Map, reflect.Slice:
			return rv, rv.IsNil() || rv.Len() == 0
		case reflect.Func, reflect.Interface:
			return rv, rv.IsNil()
		default:
			return rv, false
		}
	}
}
// Returns isDefaultValue=true iff is ultimately nil or empty
// after (recursive) dereferencing.
// If isDefaultValue=false, erv is set to the non-nil non-default
// dereferenced value.
// A zero/empty struct is not considered default for this
// function.