Chore: a bit of spring cleaning (#16710)

* Chore: use early return technic everywhere

And enable "indent-error-flow" revive rule

* Chore: remove if-return rule from revive config

* Chore: improve error messages

And enable "error-strings" revive rule

* Chore: enable "error-naming" revive rule

* Chore: make linter happy

* Chore: do not duplicate gofmt execution

* Chore: make linter happy

* Chore: address the pull review comments
This commit is contained in:
Oleg Gaidarenko
2019-04-23 11:24:47 +03:00
committed by GitHub
parent 5ce5840ae0
commit 54c1bf0cc9
21 changed files with 65 additions and 74 deletions
+5 -5
View File
@@ -5,12 +5,12 @@ import (
"errors"
"testing"
"github.com/grafana/grafana/pkg/models"
. "github.com/smartystreets/goconvey/convey"
"github.com/grafana/grafana/pkg/models"
)
var ProvokedError = errors.New("testing error.")
var ErrProvokedError = errors.New("testing error")
func TestTransaction(t *testing.T) {
ss := InitTestDB(t)
@@ -42,10 +42,10 @@ func TestTransaction(t *testing.T) {
return err
}
return ProvokedError
return ErrProvokedError
})
So(err, ShouldEqual, ProvokedError)
So(err, ShouldEqual, ErrProvokedError)
query := &models.GetApiKeyByIdQuery{ApiKeyId: cmd.Result.Id}
err = GetApiKeyById(query)