Add and fix stylecheck (golint replacement)

This commit is contained in:
Kristoffer Dalby 2021-11-15 17:24:24 +00:00
parent 0c005a6b01
commit 715542ac1c
No known key found for this signature in database
GPG key ID: 09F62DC067465735
21 changed files with 83 additions and 83 deletions

6
db.go
View file

@ -24,7 +24,7 @@ func (h *Headscale) initDB() error {
}
h.db = db
if h.dbType == POSTGRESQL {
if h.dbType == Postgres {
db.Exec("create extension if not exists \"uuid-ossp\";")
}
err = db.AutoMigrate(&Machine{})
@ -66,12 +66,12 @@ func (h *Headscale) openDB() (*gorm.DB, error) {
}
switch h.dbType {
case SQLITE:
case Sqlite:
db, err = gorm.Open(sqlite.Open(h.dbString), &gorm.Config{
DisableForeignKeyConstraintWhenMigrating: true,
Logger: log,
})
case POSTGRESQL:
case Postgres:
db, err = gorm.Open(postgres.Open(h.dbString), &gorm.Config{
DisableForeignKeyConstraintWhenMigrating: true,
Logger: log,