playground
playground copied to clipboard
rename column not working
Explain your user case and expected results
I have a column in the database named NAME and in the struct I want to call it myName, so I have this struct:
type Organisation2 struct {
ID string `gorm:"primaryKey"`
myName string `gorm:"column:NAME"` // <<<< THIS SHOULD WORK, BUT ISN'T
}
func (Organisation2) TableName() string {
return "T_ORGANISATION"
}
but when I read a row, the struct attribute myName is never filled