1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-06 00:03:32 +00:00

Fix lint issues reported by staticcheck

Used staticcheck 2022.1.2 (v0.3.2)

See: staticcheck.io
This commit is contained in:
albertony
2022-06-08 22:25:17 +02:00
parent 74bd7f3381
commit ec117593f1
66 changed files with 130 additions and 185 deletions

View File

@@ -75,7 +75,7 @@ func ParseRangeOption(s string) (po *RangeOption, err error) {
return nil, errors.New("Range: header invalid: doesn't start with " + preamble)
}
s = s[len(preamble):]
if strings.IndexRune(s, ',') >= 0 {
if strings.ContainsRune(s, ',') {
return nil, errors.New("Range: header invalid: contains multiple ranges which isn't supported")
}
dash := strings.IndexRune(s, '-')
@@ -250,7 +250,7 @@ func (o NullOption) Header() (key string, value string) {
// String formats the option into human-readable form
func (o NullOption) String() string {
return fmt.Sprintf("NullOption()")
return "NullOption()"
}
// Mandatory returns whether the option must be parsed or can be ignored