Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d4d55e8

Browse files
Merge pull request #441 from spf13/lint
fix lint violations
2 parents 024e183 + 15743bc commit d4d55e8

File tree

10 files changed

+13
-15
lines changed

10 files changed

+13
-15
lines changed

.golangci.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ linters-settings:
33
sections:
44
- standard
55
- default
6-
- prefix(github.com/spf13/viper)
6+
- prefix(github.com/spf13/afero)
77

88
linters:
99
disable-all: true
1010
enable:
11+
- gci
1112
- gofmt
12-
# - gofumpt
13+
- gofumpt
1314
- staticcheck
1415

1516
issues:

gcsfs/file.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@ import (
2626
"sort"
2727
"syscall"
2828

29-
"github.com/spf13/afero/gcsfs/internal/stiface"
30-
3129
"cloud.google.com/go/storage"
32-
3330
"google.golang.org/api/iterator"
31+
32+
"github.com/spf13/afero/gcsfs/internal/stiface"
3433
)
3534

3635
// GcsFs is the Afero version adapted for GCS

gcsfs/gcs.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ import (
2222
"time"
2323

2424
"cloud.google.com/go/storage"
25+
"google.golang.org/api/option"
26+
2527
"github.com/spf13/afero"
2628
"github.com/spf13/afero/gcsfs/internal/stiface"
27-
28-
"google.golang.org/api/option"
2929
)
3030

3131
type GcsFs struct {

gcsfs/gcs_mocks.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ import (
1818
"strings"
1919

2020
"cloud.google.com/go/storage"
21+
"google.golang.org/api/iterator"
22+
2123
"github.com/spf13/afero"
2224
"github.com/spf13/afero/gcsfs/internal/stiface"
23-
"google.golang.org/api/iterator"
2425
)
2526

2627
// sets filesystem separators to the one, expected (and hard-coded) in the tests

gcsfs/gcs_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ import (
1717
"syscall"
1818
"testing"
1919

20+
"cloud.google.com/go/storage"
2021
"golang.org/x/oauth2/google"
2122

22-
"cloud.google.com/go/storage"
2323
"github.com/spf13/afero"
2424
"github.com/spf13/afero/gcsfs/internal/stiface"
2525
)

iofs.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,6 @@ func (f fromIOFSFile) Readdir(count int) ([]os.FileInfo, error) {
255255
ret := make([]os.FileInfo, len(entries))
256256
for i := range entries {
257257
ret[i], err = entries[i].Info()
258-
259258
if err != nil {
260259
return nil, err
261260
}

iofs_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ func TestIOFSNativeDirEntryWhenPossible(t *testing.T) {
146146

147147
return nil
148148
})
149-
150149
if err != nil {
151150
t.Fatal(err)
152151
}

memmap.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@ package afero
1616
import (
1717
"fmt"
1818
"io"
19-
2019
"log"
2120
"os"
2221
"path/filepath"
23-
2422
"sort"
2523
"strings"
2624
"sync"

memmap_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ func TestMemMapFsRename(t *testing.T) {
881881
}
882882

883883
for _, dir := range data.dirs {
884-
err = fs.MkdirAll(dir, os.FileMode(0775))
884+
err = fs.MkdirAll(dir, os.FileMode(0o775))
885885
if err != nil {
886886
t.Fatalf("%s: MkdirAll %q failed: %v", fs.Name(), dir, err)
887887
}
@@ -892,7 +892,7 @@ func TestMemMapFsRename(t *testing.T) {
892892
if err != nil {
893893
t.Fatalf("%s: rename %q, %q failed: %v", fs.Name(), data.from, data.to, err)
894894
}
895-
err = fs.Mkdir(data.from, os.FileMode(0775))
895+
err = fs.Mkdir(data.from, os.FileMode(0o775))
896896
if err != nil {
897897
t.Fatalf("%s: Mkdir %q failed: %v", fs.Name(), data.from, err)
898898
}

sftpfs/sftp.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"time"
1919

2020
"github.com/pkg/sftp"
21+
2122
"github.com/spf13/afero"
2223
)
2324

0 commit comments

Comments
 (0)