diff options
author | ᴜɴᴋɴᴡᴏɴ <u@gogs.io> | 2020-03-21 13:39:32 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-21 13:39:32 +0800 |
commit | 5843038a0812cc133c1895b7410aeda7153e8708 (patch) | |
tree | 3515998242443e1a82217ee4702603819c5315c8 /internal/route/install.go | |
parent | 958d8b6bb4c2da66859325695b91d871e567a4fa (diff) |
workflows: enable golangci-lint (#5998)
* Create golint.yml
* Update golint.yml
* Update golint.yml
* Fix errcheck
* Fix gosimple
* Fix staticcheck
Diffstat (limited to 'internal/route/install.go')
-rw-r--r-- | internal/route/install.go | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/internal/route/install.go b/internal/route/install.go index 187a65a6..899393b4 100644 --- a/internal/route/install.go +++ b/internal/route/install.go @@ -11,14 +11,12 @@ import ( "path/filepath" "strings" + "github.com/gogs/git-module" "github.com/pkg/errors" "github.com/unknwon/com" "gopkg.in/ini.v1" "gopkg.in/macaron.v1" log "unknwon.dev/clog/v2" - "xorm.io/xorm" - - "github.com/gogs/git-module" "gogs.io/gogs/internal/conf" "gogs.io/gogs/internal/context" @@ -240,8 +238,7 @@ func InstallPost(c *context.Context, f form.Install) { } // Set test engine. - var x *xorm.Engine - if err := db.NewTestEngine(x); err != nil { + if err := db.NewTestEngine(); err != nil { if strings.Contains(err.Error(), `Unknown database type: sqlite3`) { c.FormErr("DbType") c.RenderWithErr(c.Tr("install.sqlite3_not_available", "https://gogs.io/docs/installation/install_from_binary.html"), INSTALL, &f) @@ -419,8 +416,8 @@ func InstallPost(c *context.Context, f form.Install) { } // Auto-login for admin - c.Session.Set("uid", u.ID) - c.Session.Set("uname", u.Name) + _ = c.Session.Set("uid", u.ID) + _ = c.Session.Set("uname", u.Name) } log.Info("First-time run install finished!") |