Skip to content

Commit

Permalink
Merge pull request #441 from spf13/lint
Browse files Browse the repository at this point in the history
fix lint violations
  • Loading branch information
sagikazarmark authored Jan 9, 2025
2 parents 024e183 + 15743bc commit d4d55e8
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 15 deletions.
5 changes: 3 additions & 2 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ linters-settings:
sections:
- standard
- default
- prefix(github.com/spf13/viper)
- prefix(github.com/spf13/afero)

linters:
disable-all: true
enable:
- gci
- gofmt
# - gofumpt
- gofumpt
- staticcheck

issues:
Expand Down
5 changes: 2 additions & 3 deletions gcsfs/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ import (
"sort"
"syscall"

"github.com/spf13/afero/gcsfs/internal/stiface"

"cloud.google.com/go/storage"

"google.golang.org/api/iterator"

"github.com/spf13/afero/gcsfs/internal/stiface"
)

// GcsFs is the Afero version adapted for GCS
Expand Down
4 changes: 2 additions & 2 deletions gcsfs/gcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import (
"time"

"cloud.google.com/go/storage"
"google.golang.org/api/option"

"github.com/spf13/afero"
"github.com/spf13/afero/gcsfs/internal/stiface"

"google.golang.org/api/option"
)

type GcsFs struct {
Expand Down
3 changes: 2 additions & 1 deletion gcsfs/gcs_mocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ import (
"strings"

"cloud.google.com/go/storage"
"google.golang.org/api/iterator"

"github.com/spf13/afero"
"github.com/spf13/afero/gcsfs/internal/stiface"
"google.golang.org/api/iterator"
)

// sets filesystem separators to the one, expected (and hard-coded) in the tests
Expand Down
2 changes: 1 addition & 1 deletion gcsfs/gcs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import (
"syscall"
"testing"

"cloud.google.com/go/storage"
"golang.org/x/oauth2/google"

"cloud.google.com/go/storage"
"github.com/spf13/afero"
"github.com/spf13/afero/gcsfs/internal/stiface"
)
Expand Down
1 change: 0 additions & 1 deletion iofs.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ func (f fromIOFSFile) Readdir(count int) ([]os.FileInfo, error) {
ret := make([]os.FileInfo, len(entries))
for i := range entries {
ret[i], err = entries[i].Info()

if err != nil {
return nil, err
}
Expand Down
1 change: 0 additions & 1 deletion iofs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ func TestIOFSNativeDirEntryWhenPossible(t *testing.T) {

return nil
})

if err != nil {
t.Fatal(err)
}
Expand Down
2 changes: 0 additions & 2 deletions memmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ package afero
import (
"fmt"
"io"

"log"
"os"
"path/filepath"

"sort"
"strings"
"sync"
Expand Down
4 changes: 2 additions & 2 deletions memmap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ func TestMemMapFsRename(t *testing.T) {
}

for _, dir := range data.dirs {
err = fs.MkdirAll(dir, os.FileMode(0775))
err = fs.MkdirAll(dir, os.FileMode(0o775))
if err != nil {
t.Fatalf("%s: MkdirAll %q failed: %v", fs.Name(), dir, err)
}
Expand All @@ -892,7 +892,7 @@ func TestMemMapFsRename(t *testing.T) {
if err != nil {
t.Fatalf("%s: rename %q, %q failed: %v", fs.Name(), data.from, data.to, err)
}
err = fs.Mkdir(data.from, os.FileMode(0775))
err = fs.Mkdir(data.from, os.FileMode(0o775))
if err != nil {
t.Fatalf("%s: Mkdir %q failed: %v", fs.Name(), data.from, err)
}
Expand Down
1 change: 1 addition & 0 deletions sftpfs/sftp.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"time"

"github.com/pkg/sftp"

"github.com/spf13/afero"
)

Expand Down

0 comments on commit d4d55e8

Please sign in to comment.