Skip to content

Commit

Permalink
build: replace the deprecated golint linter with revive
Browse files Browse the repository at this point in the history
This fixes up a small number of new lint items also
  • Loading branch information
ncw committed Oct 15, 2021
1 parent 167406b commit a98e3ea
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ linters:
- deadcode
- errcheck
- goimports
- golint
- revive
- ineffassign
- structcheck
- varcheck
Expand Down
2 changes: 1 addition & 1 deletion backend/compress/compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,7 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (rc io.Read
return o.Object.Open(ctx, options...)
}
// Get offset and limit from OpenOptions, pass the rest to the underlying remote
var openOptions []fs.OpenOption = []fs.OpenOption{&fs.SeekOption{Offset: 0}}
var openOptions = []fs.OpenOption{&fs.SeekOption{Offset: 0}}
var offset, limit int64 = 0, -1
for _, option := range options {
switch x := option.(type) {
Expand Down
2 changes: 1 addition & 1 deletion backend/tardigrade/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (_ io.ReadC
// Convert the semantics of HTTP range headers to an offset and length
// that libuplink can use.
var (
offset int64 = 0
offset int64
length int64 = -1
)

Expand Down
2 changes: 1 addition & 1 deletion backend/uptobox/uptobox.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e

var limit uint64 = 100 // max number of objects per request - 100 seems to be the maximum the api accepts
var page uint64 = 1
var offset uint64 = 0 // for the next page of requests
var offset uint64 // for the next page of requests

for {
opts := &api.MetadataRequestOptions{
Expand Down
2 changes: 1 addition & 1 deletion cmd/selfupdate/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
package selfupdate

// Note: "|" will be replaced by backticks in the help string below
var selfUpdateHelp string = `
var selfUpdateHelp = `
This command downloads the latest release of rclone and replaces
the currently running binary. The download is verified with a hashsum
and cryptographically signed signature.
Expand Down
2 changes: 1 addition & 1 deletion lib/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func NewServer(listeners, tlsListeners []net.Listener, opt Options) (Server, err
}

// Prepare TLS config
var tlsConfig *tls.Config = nil
var tlsConfig *tls.Config

useSSL := useSSL(opt)
if (opt.SslCert != "") != useSSL {
Expand Down
2 changes: 1 addition & 1 deletion vfs/vfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ func (vfs *VFS) Statfs() (total, used, free int64) {
vfs.usage, err = doAbout(ctx)
}
if vfs.Opt.UsedIsSize {
var usedBySizeAlgorithm int64 = 0
var usedBySizeAlgorithm int64
// Algorithm from `rclone size`
err = walk.ListR(ctx, vfs.f, "", true, -1, walk.ListObjects, func(entries fs.DirEntries) error {
entries.ForObject(func(o fs.Object) {
Expand Down

0 comments on commit a98e3ea

Please sign in to comment.