GORM Playground Link

https://github.com/go-gorm/playground/pull/640

Description

I have the following table:

CREATE TABLE IF NOT EXISTS example(example TEXT NOT NULL DEFAULT '^\\S+$')

I'm using gorm.io/gen to generate the models and for that case, the generated model has an invalid struct tag (also reported by linter) and the default value is not used when inserting in the DB. It works if I add \ to escape like in the above query.

// Example mapped from table <example>
type Example struct {
    Example string `gorm:"column:example;not null;default:'^\S+$'" json:"example"`
}