golang database column tags

Developer from somewhere

Comes in handy when you want a struct field to map to a db column, which may have a different name. For example, I have CreatedAt field, but in the db, it’s created_at:

type Agent struct {
	Name      string
	Config    string
	CreatedAt time.Time `db:"created_at"`
}