]> source.dussan.org Git - gitea.git/commitdiff
Fix lint errors (#2547)
authorEthan Koenig <ethantkoenig@gmail.com>
Tue, 19 Sep 2017 08:08:30 +0000 (01:08 -0700)
committerLauris BH <lauris@nix.lv>
Tue, 19 Sep 2017 08:08:30 +0000 (11:08 +0300)
models/gpg_key.go
models/issue.go
models/login_source.go
models/migrations/v16.go
models/migrations/v21.go
models/org.go
models/ssh_key.go
modules/lfs/content_store.go
modules/log/file.go

index 70dd4fbda0c39fe8fb2f53234cde7f822175de4d..85a44338ea19d2131e10ef960c706edb485e934b 100644 (file)
@@ -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
index a8149b123df8ac1194fd8e12ee87f3abfa4cda32..7884507a2721a60b4fc3d2ded4b06f0c8d65f693 100644 (file)
@@ -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 {
index 186a5e0514c7ffdd75a0cf9ffb5e6579bf87c464..c43afd58b72167d01e9a57a1b333ebf08f4477a1 100644 (file)
@@ -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
 }
index ef342a5f882b264489e0d047fdfd9ee2052a2491..8ce37ea7dbf6886a660ab793aa8154d7785f9865 100644 (file)
@@ -119,9 +119,5 @@ func addUnitsToTables(x *xorm.Engine) error {
                }
        }
 
-       if err := sess.Commit(); err != nil {
-               return err
-       }
-
-       return nil
+       return sess.Commit()
 }
index e049727cbeebebdbaf83830e3ab87d74bed73a73..890f4de22765c600b42ab38388f4629f16b10cb0 100644 (file)
@@ -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)
 }
index 31febe2543f584fc596c7472bd7bac48435751f2..eaf7ba602c2bbfd835bbdc530ec72730d8de6867 100644 (file)
@@ -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 {
index 873eab3bf3876a8a7fc1650e0eaa415804bd2ee5..539c60e696a54eb2538e17157f2522a92a338bd8 100644 (file)
@@ -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)
 }
 
 // ________                .__                 ____  __.
index 94bb10136f0e1eb394a3b046d19ee82a01e672a4..3e1b2f345b8e2fab04a92f391490daa11d223a09 100644 (file)
@@ -70,10 +70,7 @@ func (s *ContentStore) Put(meta *models.LFSMetaObject, r io.Reader) error {
                return errHashMismatch
        }
 
-       if err := os.Rename(tmpPath, path); err != nil {
-               return err
-       }
-       return nil
+       return os.Rename(tmpPath, path)
 }
 
 // Exists returns true if the object exists in the content store.
index fe6c54ec3867b05cc68e0235b6aabe2e57affd2f..18e82f7228844fe187168b4e3163b0655a77713f 100644 (file)
@@ -110,10 +110,7 @@ func (w *FileLogWriter) StartLogger() error {
                return err
        }
        w.mw.SetFd(fd)
-       if err = w.initFd(); err != nil {
-               return err
-       }
-       return nil
+       return w.initFd()
 }
 
 func (w *FileLogWriter) docheck(size int) {