summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorEthan Koenig <ethantkoenig@gmail.com>2017-09-19 01:08:30 -0700
committerLauris BH <lauris@nix.lv>2017-09-19 11:08:30 +0300
commit4cb9394a978af75794d43accc231b6649f2884bc (patch)
tree06df979841396c51d292eb5a078ece1c8af11fd9 /models
parentd155d0e6656df7b7699a4a6b60889689d6678ef5 (diff)
downloadgitea-4cb9394a978af75794d43accc231b6649f2884bc.tar.gz
gitea-4cb9394a978af75794d43accc231b6649f2884bc.zip
Fix lint errors (#2547)
Diffstat (limited to 'models')
-rw-r--r--models/gpg_key.go6
-rw-r--r--models/issue.go6
-rw-r--r--models/login_source.go5
-rw-r--r--models/migrations/v16.go6
-rw-r--r--models/migrations/v21.go5
-rw-r--r--models/org.go6
-rw-r--r--models/ssh_key.go6
7 files changed, 7 insertions, 33 deletions
diff --git a/models/gpg_key.go b/models/gpg_key.go
index 70dd4fbda0..85a44338ea 100644
--- a/models/gpg_key.go
+++ b/models/gpg_key.go
@@ -282,11 +282,7 @@ func DeleteGPGKey(doer *User, id int64) (err error) {
return err
}
- if err = sess.Commit(); err != nil {
- return err
- }
-
- return nil
+ return sess.Commit()
}
// CommitVerification represents a commit validation of signature
diff --git a/models/issue.go b/models/issue.go
index a8149b123d..7884507a27 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -571,11 +571,7 @@ func (issue *Issue) ReadBy(userID int64) error {
return err
}
- if err := setNotificationStatusReadIfUnread(x, userID, issue.ID); err != nil {
- return err
- }
-
- return nil
+ return setNotificationStatusReadIfUnread(x, userID, issue.ID)
}
func updateIssueCols(e Engine, issue *Issue, cols ...string) error {
diff --git a/models/login_source.go b/models/login_source.go
index 186a5e0514..c43afd58b7 100644
--- a/models/login_source.go
+++ b/models/login_source.go
@@ -498,10 +498,7 @@ func SMTPAuth(a smtp.Auth, cfg *SMTPConfig) error {
}
if ok, _ := c.Extension("AUTH"); ok {
- if err = c.Auth(a); err != nil {
- return err
- }
- return nil
+ return c.Auth(a)
}
return ErrUnsupportedLoginType
}
diff --git a/models/migrations/v16.go b/models/migrations/v16.go
index ef342a5f88..8ce37ea7db 100644
--- a/models/migrations/v16.go
+++ b/models/migrations/v16.go
@@ -119,9 +119,5 @@ func addUnitsToTables(x *xorm.Engine) error {
}
}
- if err := sess.Commit(); err != nil {
- return err
- }
-
- return nil
+ return sess.Commit()
}
diff --git a/models/migrations/v21.go b/models/migrations/v21.go
index e049727cbe..890f4de227 100644
--- a/models/migrations/v21.go
+++ b/models/migrations/v21.go
@@ -51,8 +51,5 @@ func useNewPublickeyFormat(x *xorm.Engine) error {
}
f.Close()
- if err = os.Rename(tmpPath, fpath); err != nil {
- return err
- }
- return nil
+ return os.Rename(tmpPath, fpath)
}
diff --git a/models/org.go b/models/org.go
index 31febe2543..eaf7ba602c 100644
--- a/models/org.go
+++ b/models/org.go
@@ -235,11 +235,7 @@ func DeleteOrganization(org *User) (err error) {
}
}
- if err = sess.Commit(); err != nil {
- return err
- }
-
- return nil
+ return sess.Commit()
}
func deleteOrg(e *xorm.Session, u *User) error {
diff --git a/models/ssh_key.go b/models/ssh_key.go
index 873eab3bf3..539c60e696 100644
--- a/models/ssh_key.go
+++ b/models/ssh_key.go
@@ -599,11 +599,7 @@ func RewriteAllPublicKeys() error {
defer f.Close()
}
- if err = os.Rename(tmpPath, fPath); err != nil {
- return err
- }
-
- return nil
+ return os.Rename(tmpPath, fPath)
}
// ________ .__ ____ __.