// SetFieldValue implements mapping.Fielder interface.
SetFieldValue implements mapping.Fielder interface.
// SetFieldValue implements mapping . Fielder interface .
func (p *Post) SetFieldValue(field *mapping.StructField, value interface{}) (err error) {
	switch field.Index[0] {
	case 0: 
		if v, ok := value.(int); ok {
			p.ID = v
			return nil
		}
		if field.DatabaseNotNull() && value == nil {
			p.ID = 0
			return nil
		}
		switch v := value.(type) {
		case int8:
			p.ID = int(v)
		case int16:
			p.ID = int(v)
		case int32:
			p.ID = int(v)
		case int64:
			p.ID = int(v)
		case uint:
			p.ID = int(v)
		case uint8:
			p.ID = int(v)
		case uint16:
			p.ID = int(v)
		case uint32:
			p.ID = int(v)
		case uint64:
			p.ID = int(v)
		case float32:
			p.ID = int(v)
		case float64:
			p.ID = int(v)
		default:
			return errors.Wrapf(mapping.ErrFieldValue, "provided invalid field type: '%T' for the field: %s", value, field.Name())
		}
		return nil
	case 1: 
		if v, ok := value.(string); ok {
			p.Title = v
			return nil
		}
		if field.DatabaseNotNull() && value == nil {
			p.Title = ""
			return nil
		}
		if v, ok := value.([]byte); ok {
			p.Title = string(v)
			return nil
		}
		return errors.Wrapf(mapping.ErrFieldValue, "provided invalid field type: '%T' for the field: %s", value, field.Name())
	case 2: 
		if v, ok := value.(string); ok {
			p.Body = v
			return nil
		}
		if field.DatabaseNotNull() && value == nil {
			p.Body = ""
			return nil
		}
		if v, ok := value.([]byte); ok {
			p.Body = string(v)
			return nil
		}
		return errors.Wrapf(mapping.ErrFieldValue, "provided invalid field type: '%T' for the field: %s", value, field.Name())
	case 3: 
		if v, ok := value.(int); ok {
			p.Likes = v
			return nil
		}
		if field.DatabaseNotNull() && value == nil {
			p.Likes = 0
			return nil
		}
		switch v := value.(type) {
		case int8:
			p.Likes = int(v)
		case int16:
			p.Likes = int(v)
		case int32:
			p.Likes = int(v)
		case int64:
			p.Likes = int(v)
		case uint:
			p.Likes = int(v)
		case uint8:
			p.Likes = int(v)
		case uint16:
			p.Likes = int(v)
		case uint32:
			p.Likes = int(v)
		case uint64:
			p.Likes = int(v)
		case float32:
			p.Likes = int(v)
		case float64:
			p.Likes = int(v)
		default:
			return errors.Wrapf(mapping.ErrFieldValue, "provided invalid field type: '%T' for the field: %s", value, field.Name())
		}
		return nil
	case 5: 
		if v, ok := value.(int); ok {
			p.BlogID = v
			return nil
		}
		if field.DatabaseNotNull() && value == nil {
			p.BlogID = 0
			return nil
		}
		switch v := value.(type) {
		case int8:
			p.BlogID = int(v)
		case int16:
			p.BlogID = int(v)
		case int32:
			p.BlogID = int(v)
		case int64:
			p.BlogID = int(v)
		case uint:
			p.BlogID = int(v)
		case uint8:
			p.BlogID = int(v)
		case uint16:
			p.BlogID = int(v)
		case uint32:
			p.BlogID = int(v)
		case uint64:
			p.BlogID = int(v)
		case float32:
			p.BlogID = int(v)
		case float64:
			p.BlogID = int(v)
		default:
			return errors.Wrapf(mapping.ErrFieldValue, "provided invalid field type: '%T' for the field: %s", value, field.Name())
		}
		return nil
	default:
		return errors.Wrapf(mapping.ErrInvalidModelField, "provided invalid field: '%s' for the model: 'Post'", field.Name())
	}
}
func ( p * Post ) SetFieldValue ( field * mapping . StructField , value interface { } ) ( err error ) { switch field . Index [ 0 ] { case 0 : if v , ok := value . ( int ) ; ok { p . ID = v return nil } if field . DatabaseNotNull ( ) && value == nil { p . ID = 0 return nil } switch v := value . ( type ) { case int8 : p . ID = int ( v ) case int16 : p . ID = int ( v ) case int32 : p . ID = int ( v ) case int64 : p . ID = int ( v ) case uint : p . ID = int ( v ) case uint8 : p . ID = int ( v ) case uint16 : p . ID = int ( v ) case uint32 : p . ID = int ( v ) case uint64 : p . ID = int ( v ) case float32 : p . ID = int ( v ) case float64 : p . ID = int ( v ) default : return errors . Wrapf ( mapping . ErrFieldValue , " " , value , field . Name ( ) ) } return nil case 1 : if v , ok := value . ( string ) ; ok { p . Title = v return nil } if field . DatabaseNotNull ( ) && value == nil { p . Title = " " return nil } if v , ok := value . ( [ ] byte ) ; ok { p . Title = string ( v ) return nil } return errors . Wrapf ( mapping . ErrFieldValue , " " , value , field . Name ( ) ) case 2 : if v , ok := value . ( string ) ; ok { p . Body = v return nil } if field . DatabaseNotNull ( ) && value == nil { p . Body = " " return nil } if v , ok := value . ( [ ] byte ) ; ok { p . Body = string ( v ) return nil } return errors . Wrapf ( mapping . ErrFieldValue , " " , value , field . Name ( ) ) case 3 : if v , ok := value . ( int ) ; ok { p . Likes = v return nil } if field . DatabaseNotNull ( ) && value == nil { p . Likes = 0 return nil } switch v := value . ( type ) { case int8 : p . Likes = int ( v ) case int16 : p . Likes = int ( v ) case int32 : p . Likes = int ( v ) case int64 : p . Likes = int ( v ) case uint : p . Likes = int ( v ) case uint8 : p . Likes = int ( v ) case uint16 : p . Likes = int ( v ) case uint32 : p . Likes = int ( v ) case uint64 : p . Likes = int ( v ) case float32 : p . Likes = int ( v ) case float64 : p . Likes = int ( v ) default : return errors . Wrapf ( mapping . ErrFieldValue , " " , value , field . Name ( ) ) } return nil case 5 : if v , ok := value . ( int ) ; ok { p . BlogID = v return nil } if field . DatabaseNotNull ( ) && value == nil { p . BlogID = 0 return nil } switch v := value . ( type ) { case int8 : p . BlogID = int ( v ) case int16 : p . BlogID = int ( v ) case int32 : p . BlogID = int ( v ) case int64 : p . BlogID = int ( v ) case uint : p . BlogID = int ( v ) case uint8 : p . BlogID = int ( v ) case uint16 : p . BlogID = int ( v ) case uint32 : p . BlogID = int ( v ) case uint64 : p . BlogID = int ( v ) case float32 : p . BlogID = int ( v ) case float64 : p . BlogID = int ( v ) default : return errors . Wrapf ( mapping . ErrFieldValue , " " , value , field . Name ( ) ) } return nil default : return errors . Wrapf ( mapping . ErrInvalidModelField , " " , field . Name ( ) ) } }
SetFieldValue implements mapping.Fielder interface.
SetFieldValue implements mapping . Fielder interface .
// ID // Title // Check alternate types for the Title. // Body // Check alternate types for the Body. // Likes // BlogID