func ErrCode(err error) string {
	type ErrorCoder interface {
		ErrorCode() string
	}
	switch err := errors.Cause(err).(type) {
	case ErrorCoder:
		return err.ErrorCode()
	default:
		return ""
	}
}
// ErrCode returns the error code associated with
// the given error, or the empty string if there
// is none.
ErrCode returns the error code associated with
the given error, or the empty string if there
is none.
// ErrCode returns the error code associated with // the given error or the empty string if there // is none .
func ErrCode(err error) string {
	type ErrorCoder interface {
		ErrorCode() string
	}
	switch err := errors.Cause(err).(type) {
	case ErrorCoder:
		return err.ErrorCode()
	default:
		return ""
	}
}
func ErrCode ( err error ) string { type ErrorCoder interface { ErrorCode ( ) string } switch err := errors . Cause ( err ) . ( type ) { case ErrorCoder : return err . ErrorCode ( ) default : return " " } }
ErrCode returns the error code associated with
the given error, or the empty string if there
is none.
ErrCode returns the error code associated with the given error or the empty string if there is none .