mirror of https://github.com/gogs/gogs.git
autofix: format code with gofumpt and gofmt (#6803)
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>pull/6811/head
parent
2466da4e82
commit
e452d94fc8
internal
auth/pam
gitutil
process
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build pam
|
||||||
// +build pam
|
// +build pam
|
||||||
|
|
||||||
// Copyright 2014 The Gogs Authors. All rights reserved.
|
// Copyright 2014 The Gogs Authors. All rights reserved.
|
||||||
|
|
|
@ -42,8 +42,10 @@ portable among all supported database engines.`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
const currentBackupFormatVersion = 1
|
const (
|
||||||
const archiveRootDir = "gogs-backup"
|
currentBackupFormatVersion = 1
|
||||||
|
archiveRootDir = "gogs-backup"
|
||||||
|
)
|
||||||
|
|
||||||
func runBackup(c *cli.Context) error {
|
func runBackup(c *cli.Context) error {
|
||||||
zip.Verbose = c.Bool("verbose")
|
zip.Verbose = c.Bool("verbose")
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build cert
|
||||||
// +build cert
|
// +build cert
|
||||||
|
|
||||||
// Copyright 2009 The Go Authors. All rights reserved.
|
// Copyright 2009 The Go Authors. All rights reserved.
|
||||||
|
|
|
@ -456,7 +456,6 @@ func runWeb(c *cli.Context) error {
|
||||||
Post(bindIgnErr(form.AddSSHKey{}), repo.SettingsDeployKeysPost)
|
Post(bindIgnErr(form.AddSSHKey{}), repo.SettingsDeployKeysPost)
|
||||||
m.Post("/delete", repo.DeleteDeployKey)
|
m.Post("/delete", repo.DeleteDeployKey)
|
||||||
})
|
})
|
||||||
|
|
||||||
}, func(c *context.Context) {
|
}, func(c *context.Context) {
|
||||||
c.Data["PageIsSettings"] = true
|
c.Data["PageIsSettings"] = true
|
||||||
})
|
})
|
||||||
|
@ -734,7 +733,8 @@ func runWeb(c *cli.Context) error {
|
||||||
tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
|
tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
|
||||||
tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
|
tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
|
||||||
},
|
},
|
||||||
}, Handler: m}
|
}, Handler: m,
|
||||||
|
}
|
||||||
err = server.ListenAndServeTLS(conf.Server.CertFile, conf.Server.KeyFile)
|
err = server.ListenAndServeTLS(conf.Server.CertFile, conf.Server.KeyFile)
|
||||||
|
|
||||||
case "fcgi":
|
case "fcgi":
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build minwinsvc
|
||||||
// +build minwinsvc
|
// +build minwinsvc
|
||||||
|
|
||||||
// Copyright 2015 The Gogs Authors. All rights reserved.
|
// Copyright 2015 The Gogs Authors. All rights reserved.
|
||||||
|
|
|
@ -83,7 +83,7 @@ func getEngine() (*xorm.Engine, error) {
|
||||||
connStr = fmt.Sprintf("%s:%s@tcp(%s)/%s%scharset=utf8mb4&parseTime=true",
|
connStr = fmt.Sprintf("%s:%s@tcp(%s)/%s%scharset=utf8mb4&parseTime=true",
|
||||||
conf.Database.User, conf.Database.Password, conf.Database.Host, conf.Database.Name, Param)
|
conf.Database.User, conf.Database.Password, conf.Database.Host, conf.Database.Name, Param)
|
||||||
}
|
}
|
||||||
var engineParams = map[string]string{"rowFormat": "DYNAMIC"}
|
engineParams := map[string]string{"rowFormat": "DYNAMIC"}
|
||||||
return xorm.NewEngineWithParams(conf.Database.Type, connStr, engineParams)
|
return xorm.NewEngineWithParams(conf.Database.Type, connStr, engineParams)
|
||||||
|
|
||||||
case "postgres":
|
case "postgres":
|
||||||
|
|
|
@ -41,6 +41,7 @@ func Test_perms(t *testing.T) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func test_perms_AccessMode(t *testing.T, db *perms) {
|
func test_perms_AccessMode(t *testing.T, db *perms) {
|
||||||
// Set up permissions
|
// Set up permissions
|
||||||
err := db.SetRepoPerms(1, map[int64]AccessMode{
|
err := db.SetRepoPerms(1, map[int64]AccessMode{
|
||||||
|
|
|
@ -20,7 +20,6 @@ type Error struct {
|
||||||
func (e Error) NotFound() bool {
|
func (e Error) NotFound() bool {
|
||||||
return IsErrSubmoduleNotExist(e.error) ||
|
return IsErrSubmoduleNotExist(e.error) ||
|
||||||
IsErrRevisionNotExist(e.error)
|
IsErrRevisionNotExist(e.error)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewError wraps given error.
|
// NewError wraps given error.
|
||||||
|
|
|
@ -15,9 +15,7 @@ import (
|
||||||
log "unknwon.dev/clog/v2"
|
log "unknwon.dev/clog/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var ErrExecTimeout = errors.New("process execution timeout")
|
||||||
ErrExecTimeout = errors.New("process execution timeout")
|
|
||||||
)
|
|
||||||
|
|
||||||
const DEFAULT_TIMEOUT = 60 * time.Second
|
const DEFAULT_TIMEOUT = 60 * time.Second
|
||||||
|
|
||||||
|
@ -41,8 +39,10 @@ func (c *pidCounter) PID() int64 {
|
||||||
return c.pid
|
return c.pid
|
||||||
}
|
}
|
||||||
|
|
||||||
var counter = new(pidCounter)
|
var (
|
||||||
var Processes []*Process
|
counter = new(pidCounter)
|
||||||
|
Processes []*Process
|
||||||
|
)
|
||||||
|
|
||||||
// Add adds a process to global list and returns its PID.
|
// Add adds a process to global list and returns its PID.
|
||||||
func Add(desc string, cmd *exec.Cmd) int64 {
|
func Add(desc string, cmd *exec.Cmd) int64 {
|
||||||
|
|
|
@ -27,7 +27,6 @@ func RegisterRoutes(r *macaron.Router) {
|
||||||
r.Group("", func() {
|
r.Group("", func() {
|
||||||
r.Post("/objects/batch", authorize(db.AccessModeRead), verifyAccept, verifyContentTypeJSON, serveBatch)
|
r.Post("/objects/batch", authorize(db.AccessModeRead), verifyAccept, verifyContentTypeJSON, serveBatch)
|
||||||
r.Group("/objects/basic", func() {
|
r.Group("/objects/basic", func() {
|
||||||
|
|
||||||
basic := &basicHandler{
|
basic := &basicHandler{
|
||||||
defaultStorage: lfsutil.Storage(conf.LFS.Storage),
|
defaultStorage: lfsutil.Storage(conf.LFS.Storage),
|
||||||
storagers: map[lfsutil.Storage]lfsutil.Storager{
|
storagers: map[lfsutil.Storage]lfsutil.Storager{
|
||||||
|
|
|
@ -553,7 +553,6 @@ func PrepareCompareDiff(
|
||||||
meta *gitutil.PullRequestMeta,
|
meta *gitutil.PullRequestMeta,
|
||||||
headBranch string,
|
headBranch string,
|
||||||
) bool {
|
) bool {
|
||||||
|
|
||||||
var (
|
var (
|
||||||
repo = c.Repo.Repository
|
repo = c.Repo.Repository
|
||||||
err error
|
err error
|
||||||
|
|
Loading…
Reference in New Issue