func NewFieldInvalid(field string, value interface{}, detail string) *ValidationError {
	return &ValidationError{ValidationErrorTypeInvalid, field, value, detail}
}
NewFieldInvalid returns a *ValidationError indicating "invalid value"
package errors
import (
	"fmt"
	"strings"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/util/errors"
	"github.com/davecgh/go-spew/spew"
	"github.com/golang/glog"
)
type ValidationErrorType string
const (
	ValidationErrorTypeNotFound ValidationErrorType = "FieldValueNotFound"
	ValidationErrorTypeRequired ValidationErrorType = "FieldValueRequired"
	ValidationErrorTypeDuplicate ValidationErrorType = "FieldValueDuplicate"
	ValidationErrorTypeInvalid ValidationErrorType = "FieldValueInvalid"
	ValidationErrorTypeNotSupported ValidationErrorType = "FieldValueNotSupported"
	ValidationErrorTypeForbidden ValidationErrorType = "FieldValueForbidden"
)
func (t ValidationErrorType) String() string {
	switch t {
	case ValidationErrorTypeNotFound:
		return "not found"
	case ValidationErrorTypeRequired:
		return "required value"
	case ValidationErrorTypeDuplicate:
		return "duplicate value"
	case ValidationErrorTypeInvalid:
		return "invalid value"
	case ValidationErrorTypeNotSupported:
		return "unsupported value"
	case ValidationErrorTypeForbidden:
		return "forbidden"
	default:
		glog.Errorf("unrecognized validation type: %#v", t)
		return ""
	}
}
type ValidationError struct {
	Type     ValidationErrorType
	Field    string
	BadValue interface{}
	Detail   string
}
var _ error = &ValidationError{}
func (v *ValidationError) Error() string {
	var s string
	switch v.Type {
	case ValidationErrorTypeRequired:
		s = spew.Sprintf("%s: %s", v.Field, v.Type)
	default:
		s = spew.Sprintf("%s: %s '%+v'", v.Field, v.Type, v.BadValue)
	}
	if len(v.Detail) != 0 {
		s += fmt.Sprintf(": %s", v.Detail)
	}
	return s
}
func NewFieldRequired(field string, value interface{}) *ValidationError {
	return &ValidationError{ValidationErrorTypeRequired, field, value, ""}
}