// SetPrimaryKey implements mapping.Model interface method.
SetPrimaryKey implements mapping.Model interface method.
// SetPrimaryKey implements mapping . Model interface method .
func (p *Post) SetPrimaryKeyValue(value interface{}) error {
	if v, ok := value.(int); ok {
		p.ID = v
		return nil
	}
	switch valueType := value.(type) {
	case int8:
		p.ID = int(valueType)
	case int16:
		p.ID = int(valueType)
	case int32:
		p.ID = int(valueType)
	case int64:
		p.ID = int(valueType)
	case uint:
		p.ID = int(valueType)
	case uint8:
		p.ID = int(valueType)
	case uint16:
		p.ID = int(valueType)
	case uint32:
		p.ID = int(valueType)
	case uint64:
		p.ID = int(valueType)
	case float32:
		p.ID = int(valueType)
	case float64:
		p.ID = int(valueType)
	default:
		return errors.Wrapf(mapping.ErrFieldValue, "provided invalid value: '%T' for the primary field for model: 'Post'", value)
	}
	return nil
}
func ( p * Post ) SetPrimaryKeyValue ( value interface { } ) error { if v , ok := value . ( int ) ; ok { p . ID = v return nil } switch valueType := value . ( type ) { case int8 : p . ID = int ( valueType ) case int16 : p . ID = int ( valueType ) case int32 : p . ID = int ( valueType ) case int64 : p . ID = int ( valueType ) case uint : p . ID = int ( valueType ) case uint8 : p . ID = int ( valueType ) case uint16 : p . ID = int ( valueType ) case uint32 : p . ID = int ( valueType ) case uint64 : p . ID = int ( valueType ) case float32 : p . ID = int ( valueType ) case float64 : p . ID = int ( valueType ) default : return errors . Wrapf ( mapping . ErrFieldValue , " " , value ) } return nil }
SetPrimaryKey implements mapping.Model interface method.
SetPrimaryKey implements mapping . Model interface method .
// Check alternate types for given field.