From e80ae4e09c43aac083c018d4128ad9625856f494 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 5 May 2018 11:33:01 +0100 Subject: [PATCH] build: remove unused struct fields spotted by structcheck --- backend/azureblob/azureblob.go | 1 - backend/crypt/crypt.go | 1 - backend/webdav/webdav.go | 1 - backend/yandex/yandex.go | 11 +++++------ cmd/ncdu/scan/scan.go | 17 +++++++---------- fs/fshttp/http.go | 5 +---- fs/operations/operations.go | 1 - 7 files changed, 13 insertions(+), 24 deletions(-) diff --git a/backend/azureblob/azureblob.go b/backend/azureblob/azureblob.go index 861bc3740..4b1a7dd06 100644 --- a/backend/azureblob/azureblob.go +++ b/backend/azureblob/azureblob.go @@ -95,7 +95,6 @@ type Fs struct { type Object struct { fs *Fs // what this object is part of remote string // The remote path - id string // azure id of the file modTime time.Time // The modified time of the object if known md5 string // MD5 hash if known size int64 // Size of the object diff --git a/backend/crypt/crypt.go b/backend/crypt/crypt.go index cd4a009f0..de6b64590 100644 --- a/backend/crypt/crypt.go +++ b/backend/crypt/crypt.go @@ -168,7 +168,6 @@ type Fs struct { root string features *fs.Features // optional features cipher Cipher - mode NameEncryptionMode } // Name of the remote (as passed into NewFs) diff --git a/backend/webdav/webdav.go b/backend/webdav/webdav.go index 6c98ac445..86ec2e0a8 100644 --- a/backend/webdav/webdav.go +++ b/backend/webdav/webdav.go @@ -116,7 +116,6 @@ type Object struct { hasMetaData bool // whether info below has been set size int64 // size of the object modTime time.Time // modification time of the object - id string // ID of the object sha1 string // SHA-1 of the object content } diff --git a/backend/yandex/yandex.go b/backend/yandex/yandex.go index 3aa9a2b72..11c2e9d46 100644 --- a/backend/yandex/yandex.go +++ b/backend/yandex/yandex.go @@ -69,12 +69,11 @@ func init() { // Fs represents a remote yandex type Fs struct { - name string - root string //root path - features *fs.Features // optional features - yd *yandex.Client // client for rest api - diskRoot string //root path with "disk:/" container name - mkdircache map[string]int + name string + root string //root path + features *fs.Features // optional features + yd *yandex.Client // client for rest api + diskRoot string //root path with "disk:/" container name } // Object describes a swift object diff --git a/cmd/ncdu/scan/scan.go b/cmd/ncdu/scan/scan.go index 6f8e89248..b835ef4fd 100644 --- a/cmd/ncdu/scan/scan.go +++ b/cmd/ncdu/scan/scan.go @@ -12,16 +12,13 @@ import ( // Dir represents a directory found in the remote type Dir struct { - parent *Dir - path string - mu sync.Mutex - count int64 - size int64 - complete bool - entries fs.DirEntries - dirs map[string]*Dir - offset int // current listing offset - entry int // current listing entry + parent *Dir + path string + mu sync.Mutex + count int64 + size int64 + entries fs.DirEntries + dirs map[string]*Dir } // Parent returns the directory above this one diff --git a/fs/fshttp/http.go b/fs/fshttp/http.go index 642acbc1e..e8240c9a5 100644 --- a/fs/fshttp/http.go +++ b/fs/fshttp/http.go @@ -42,10 +42,7 @@ func StartHTTPTokenBucket() { // A net.Conn that sets a deadline for every Read or Write operation type timeoutConn struct { net.Conn - readTimer *time.Timer - writeTimer *time.Timer - timeout time.Duration - off time.Time + timeout time.Duration } // create a timeoutConn using the timeout diff --git a/fs/operations/operations.go b/fs/operations/operations.go index 90fb74a4f..88e69572c 100644 --- a/fs/operations/operations.go +++ b/fs/operations/operations.go @@ -1368,7 +1368,6 @@ type ListFormat struct { dirSlash bool output []func() string entry fs.DirEntry - hash bool } // SetSeparator changes separator in struct