Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Valient Gough committed Apr 19, 2021
1 parent 9f9449d commit ba149e6
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 11 deletions.
16 changes: 15 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,18 @@ linters-settings:
linters:
enable-all: true
disable:
- gochecknoglobals
- exhaustivestruct
- funlen
- gochecknoglobals
- gochecknoinits
- gocognit
- gofumpt
- gomnd
- maligned
- nestif
- nlreturn
- paralleltest
- testpackage
- whitespace
- wrapcheck
- wsl
3 changes: 1 addition & 2 deletions fuse/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ package fuse
// type MyFs struct {
// fuse.DefaultFileSystem
// }
type DefaultFileSystem struct {
}
type DefaultFileSystem struct{}

var _ FileSystem = &DefaultFileSystem{}

Expand Down
1 change: 1 addition & 0 deletions fuse/bridge_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func (a *InoAttr) toCStat(o *C.struct_stat, timeout *C.double) {
if a.GID != nil {
o.st_gid = C.__gid_t(*a.GID)
}

toCTime(&o.st_ctim, a.CTime)
toCTime(&o.st_mtim, a.MTime)
toCTime(&o.st_atim, a.ATime)
Expand Down
3 changes: 2 additions & 1 deletion fuse/bridge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func TestLookup(t *testing.T) {
default:
t.Errorf("Unexpected reply: %#v", r)
}

return int(OK)
})
})
Expand Down Expand Up @@ -91,7 +92,7 @@ func TestGetAttr(t *testing.T) {
t.Run("GetAttr on existing directory", func(t *testing.T) {
bridgeGetAttr(fsID, 1, func(id int, r interface{}) int {
require.IsType(t, &replyAttr{}, r)
a := r.(*replyAttr)
a, _ := r.(*replyAttr)
stat := a.attr
require.NotNil(t, stat)
require.EqualValues(t, 1, stat.st_ino)
Expand Down
3 changes: 1 addition & 2 deletions fuse/memfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,7 @@ func (m *MemFS) Write(p []byte, ino int64, off int64, fi *FileInfo) (int, Status
return 0, err
}

rl := int(off) + len(p)
if rl > len(n.file.data) {
if rl := int(off) + len(p); rl > len(n.file.data) {
// Extend
newSlice := make([]byte, rl)
copy(newSlice, n.file.data)
Expand Down
10 changes: 5 additions & 5 deletions fuse/raw.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,11 @@ type FileInfo struct {
Writepage bool
// Bitfields not supported by CGO.
// TODO: create separate wrapper?
//DirectIo bool
//KeepCache bool
//Flush bool
//NonSeekable bool
//FlockRelease bool
// DirectIo bool
// KeepCache bool
// Flush bool
// NonSeekable bool
// FlockRelease bool
Handle uint64
LockOwner uint64
}
Expand Down

0 comments on commit ba149e6

Please sign in to comment.