* Added .deepsource.toml
* Removed empty default in select
* Removed unnecessary use of slice
* Fixed check for empty string
--- /dev/null
+version = 1
+
+test_patterns = ["**/*_test.go"]
+
+[[analyzers]]
+name = "go"
+enabled = true
+
+ [analyzers.meta]
+ import_paths = ["github.com/anacrolix/torrent"]
+
)
func isSubPath(parent, child string) bool {
- if len(parent) == 0 {
+ if parent == "" {
return len(child) > 0
}
if !strings.HasPrefix(child, parent) {
return false
}
extra := child[len(parent):]
- if len(extra) == 0 {
+ if extra == "" {
return false
}
// Not just a file with more stuff on the end.
return ret
}
}()
- cr.c.XORKeyStream(be[:], b)
+ cr.c.XORKeyStream(be, b)
n, err = cr.w.Write(be[:len(b)])
if n != len(b) {
// The cipher will have advanced beyond the callers stream position.
go b.Write([]byte(bData))
// Need to be exact here, as there are several reads, and net.Pipe is most synchronous.
msg := make([]byte, len(ia)+len(aData))
- n, _ := io.ReadFull(b, msg[:])
+ n, _ := io.ReadFull(b, msg)
if n != len(msg) {
t.FailNow()
}
}
case <-closeChan:
return
- default:
+
}
}
}()