Skip to content

Commit

Permalink
updated linter
Browse files Browse the repository at this point in the history
  • Loading branch information
ganigeorgiev committed Dec 16, 2022
1 parent 738f71f commit 687a79b
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 12 deletions.
3 changes: 2 additions & 1 deletion apis/health_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package apis_test

import (
"github.com/pocketbase/pocketbase/tests"
"net/http"
"testing"

"github.com/pocketbase/pocketbase/tests"
)

func TestHealthAPI(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions daos/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ func (dao *Dao) NonconcurrentDB() dbx.Builder {
// }
// defer app.Dao().Continue()
//
// return app.Dao().RunInTransaction(func (txDao *daos.Dao) error {
// // some long running read&write transaction...
// })
// return app.Dao().RunInTransaction(func (txDao *daos.Dao) error {
// // some long running read&write transaction...
// })
// }
func (dao *Dao) Block(ctx context.Context) error {
if dao.sem == nil {
Expand Down
3 changes: 0 additions & 3 deletions golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ linters:
disable-all: true
enable:
- asciicheck
- deadcode
- depguard
- exportloopref
- gocritic
- gofmt
- goimports
- gomodguard
Expand All @@ -26,5 +24,4 @@ linters:
- typecheck
- unconvert
- unused
- varcheck
- whitespace
4 changes: 2 additions & 2 deletions tools/auth/base_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package auth
import (
"context"
"fmt"
"io/ioutil"
"io"
"net/http"

"golang.org/x/oauth2"
Expand Down Expand Up @@ -125,7 +125,7 @@ func (p *baseProvider) sendRawUserDataRequest(req *http.Request, token *oauth2.T
}
defer response.Body.Close()

result, err := ioutil.ReadAll(response.Body)
result, err := io.ReadAll(response.Body)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions tools/auth/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package auth

import (
"encoding/json"
"io/ioutil"
"io"
"strconv"

"golang.org/x/oauth2"
Expand Down Expand Up @@ -75,7 +75,7 @@ func (p *Github) FetchAuthUser(token *oauth2.Token) (*AuthUser, error) {
}
defer response.Body.Close()

content, err := ioutil.ReadAll(response.Body)
content, err := io.ReadAll(response.Body)
if err != nil {
return user, err
}
Expand Down
4 changes: 4 additions & 0 deletions tools/filesystem/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ func TestNewFileFromFromPath(t *testing.T) {

func TestNewFileFromMultipart(t *testing.T) {
formData, mp, err := tests.MockMultipartData(nil, "test")
if err != nil {
t.Fatal(err)
}

req := httptest.NewRequest("", "/", formData)
req.Header.Set(echo.HeaderContentType, mp.FormDataContentType())
req.ParseMultipartForm(32 << 20)
Expand Down
2 changes: 1 addition & 1 deletion tools/mailer/smtp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func TestLoginAuthStart(t *testing.T) {
}

if len(resp) != 0 {
t.Fatalf("[%s] Expected emtpy data response, got %v", s.name, resp)
t.Fatalf("[%s] Expected empty data response, got %v", s.name, resp)
}

if method != "LOGIN" {
Expand Down

0 comments on commit 687a79b

Please sign in to comment.