package configs import "fmt" type Mysql struct { GeneralDB `yaml:",inline" mapstructure:",squash"` } func (m *Mysql) Dsn() string { return fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?charset=utf8&parseTime=true&loc=Asia%%2FShanghai", m.Username, m.Password, m.Path, m.Port, m.Dbname) }