1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-02 08:57:32 -04:00

Fix lint errors (#2547)

This commit is contained in:
Ethan Koenig 2017-09-19 01:08:30 -07:00 committed by Lauris BH
parent d155d0e665
commit 4cb9394a97
9 changed files with 9 additions and 41 deletions

View 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

View 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 {

View 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
}

View File

@ -119,9 +119,5 @@ func addUnitsToTables(x *xorm.Engine) error {
}
}
if err := sess.Commit(); err != nil {
return err
}
return nil
return sess.Commit()
}

View 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)
}

View 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 {

View 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)
}
// ________ .__ ____ __.

View 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.

View 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) {