func isZero(v reflect.Value) bool {
	switch v.Kind() {
	case reflect.Invalid:
		return true
	case reflect.Bool:
		return !v.Bool()
	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
		return v.Int() == 0
	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
		return v.Uint() == 0
	case reflect.Float32, reflect.Float64:
		return math.Float64bits(v.Float()) == 0
	case reflect.Complex64, reflect.Complex128:
		c := v.Complex()
		return math.Float64bits(real(c)) == 0 && math.Float64bits(imag(c)) == 0
	case reflect.Array:
		for i := 0; i < v.Len(); i++ {
			if !isZero(v.Index(i)) {
				return false
			}
		}
		return true
	case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice, reflect.UnsafePointer:
		return v.IsNil()
	case reflect.String:
		return v.Len() == 0
	case reflect.Struct:
		for i := 0; i < v.NumField(); i++ {
			if !isZero(v.Field(i)) {
				return false
			}
		}
		return true
	default:
		// This should never happens, but will act as a safeguard for
		// later, as a default value doesn't makes sense here.
		panic(fmt.Sprintf("unexpected value of type %s passed to isZero", v.Kind().String()))
	}
}
// isZero reports whether v is the zero value for its type. It panics if the
// argument is invalid. The implementation has been copied from the upstream Go
// repo as it has not made its way to a stable Go release yet.
isZero reports whether v is the zero value for its type. It panics if the
argument is invalid. The implementation has been copied from the upstream Go
repo as it has not made its way to a stable Go release yet.
// isZero reports whether v is the zero value for its type . It panics if the // argument is invalid . The implementation has been copied from the upstream Go // repo as it has not made its way to a stable Go release yet .
func isZero(v reflect.Value) bool {
	switch v.Kind() {
	case reflect.Invalid:
		return true
	case reflect.Bool:
		return !v.Bool()
	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
		return v.Int() == 0
	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
		return v.Uint() == 0
	case reflect.Float32, reflect.Float64:
		return math.Float64bits(v.Float()) == 0
	case reflect.Complex64, reflect.Complex128:
		c := v.Complex()
		return math.Float64bits(real(c)) == 0 && math.Float64bits(imag(c)) == 0
	case reflect.Array:
		for i := 0; i < v.Len(); i++ {
			if !isZero(v.Index(i)) {
				return false
			}
		}
		return true
	case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice, reflect.UnsafePointer:
		return v.IsNil()
	case reflect.String:
		return v.Len() == 0
	case reflect.Struct:
		for i := 0; i < v.NumField(); i++ {
			if !isZero(v.Field(i)) {
				return false
			}
		}
		return true
	default:
		panic(fmt.Sprintf("unexpected value of type %s passed to isZero", v.Kind().String()))
	}
}
func isZero ( v reflect . Value ) bool { switch v . Kind ( ) { case reflect . Invalid : return true case reflect . Bool : return ! v . Bool ( ) case reflect . Int , reflect . Int8 , reflect . Int16 , reflect . Int32 , reflect . Int64 : return v . Int ( ) == 0 case reflect . Uint , reflect . Uint8 , reflect . Uint16 , reflect . Uint32 , reflect . Uint64 , reflect . Uintptr : return v . Uint ( ) == 0 case reflect . Float32 , reflect . Float64 : return math . Float64bits ( v . Float ( ) ) == 0 case reflect . Complex64 , reflect . Complex128 : c := v . Complex ( ) return math . Float64bits ( real ( c ) ) == 0 && math . Float64bits ( imag ( c ) ) == 0 case reflect . Array : for i := 0 ; i < v . Len ( ) ; i ++ { if ! isZero ( v . Index ( i ) ) { return false } } return true case reflect . Chan , reflect . Func , reflect . Interface , reflect . Map , reflect . Ptr , reflect . Slice , reflect . UnsafePointer : return v . IsNil ( ) case reflect . String : return v . Len ( ) == 0 case reflect . Struct : for i := 0 ; i < v . NumField ( ) ; i ++ { if ! isZero ( v . Field ( i ) ) { return false } } return true default : panic ( fmt . Sprintf ( " " , v . Kind ( ) . String ( ) ) ) } }
isZero reports whether v is the zero value for its type.
isZero reports whether v is the zero value for its type .
// This should never happens, but will act as a safeguard for // later, as a default value doesn't makes sense here.