mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
format with gofumpt (#18184)
* gofumpt -w -l . * gofumpt -w -l -extra . * Add linter * manual fix * change make fmt
This commit is contained in:
@@ -90,7 +90,7 @@ type FindRepoArchiversOption struct {
|
||||
}
|
||||
|
||||
func (opts FindRepoArchiversOption) toConds() builder.Cond {
|
||||
var cond = builder.NewCond()
|
||||
cond := builder.NewCond()
|
||||
if opts.OlderThan > 0 {
|
||||
cond = cond.And(builder.Lt{"created_unix": time.Now().Add(-opts.OlderThan).Unix()})
|
||||
}
|
||||
@@ -99,7 +99,7 @@ func (opts FindRepoArchiversOption) toConds() builder.Cond {
|
||||
|
||||
// FindRepoArchives find repo archivers
|
||||
func FindRepoArchives(opts FindRepoArchiversOption) ([]*RepoArchiver, error) {
|
||||
var archivers = make([]*RepoArchiver, 0, opts.PageSize)
|
||||
archivers := make([]*RepoArchiver, 0, opts.PageSize)
|
||||
start, limit := opts.GetSkipTake()
|
||||
err := db.GetEngine(db.DefaultContext).Where(opts.toConds()).
|
||||
Asc("created_unix").
|
||||
|
@@ -241,7 +241,7 @@ func UpdateAttachmentByUUID(ctx context.Context, attach *Attachment, cols ...str
|
||||
|
||||
// UpdateAttachmentCtx updates the given attachment in database
|
||||
func UpdateAttachmentCtx(ctx context.Context, atta *Attachment) error {
|
||||
var sess = db.GetEngine(ctx).Cols("name", "issue_id", "release_id", "comment_id", "download_count")
|
||||
sess := db.GetEngine(ctx).Cols("name", "issue_id", "release_id", "comment_id", "download_count")
|
||||
if atta.ID != 0 && atta.UUID == "" {
|
||||
sess = sess.ID(atta.ID)
|
||||
} else {
|
||||
|
@@ -17,10 +17,8 @@ import (
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
|
||||
var (
|
||||
// ErrMirrorNotExist mirror does not exist error
|
||||
ErrMirrorNotExist = errors.New("Mirror does not exist")
|
||||
)
|
||||
// ErrMirrorNotExist mirror does not exist error
|
||||
var ErrMirrorNotExist = errors.New("Mirror does not exist")
|
||||
|
||||
// RemoteMirrorer defines base methods for pull/push mirrors.
|
||||
type RemoteMirrorer interface {
|
||||
|
@@ -15,10 +15,8 @@ import (
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
|
||||
var (
|
||||
// ErrPushMirrorNotExist mirror does not exist error
|
||||
ErrPushMirrorNotExist = errors.New("PushMirror does not exist")
|
||||
)
|
||||
// ErrPushMirrorNotExist mirror does not exist error
|
||||
var ErrPushMirrorNotExist = errors.New("PushMirror does not exist")
|
||||
|
||||
// PushMirror represents mirror information of a repository.
|
||||
type PushMirror struct {
|
||||
|
Reference in New Issue
Block a user