mirror of
https://github.com/restic/restic.git
synced 2025-12-11 18:47:50 +00:00
Fix linter warnings
This commit is contained in:
@@ -45,10 +45,7 @@ func readPEMCertKey(filename string) (certs []byte, key []byte, err error) {
|
||||
}
|
||||
|
||||
var block *pem.Block
|
||||
for {
|
||||
if len(data) == 0 {
|
||||
break
|
||||
}
|
||||
for len(data) > 0 {
|
||||
block, data = pem.Decode(data)
|
||||
if block == nil {
|
||||
break
|
||||
|
||||
@@ -34,6 +34,7 @@ func isPath(s string) bool {
|
||||
|
||||
// check for drive paths
|
||||
drive := s[0]
|
||||
//nolint:staticcheck // de morgan's law makes this harder to read
|
||||
if !(drive >= 'a' && drive <= 'z') && !(drive >= 'A' && drive <= 'Z') {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -79,8 +79,8 @@ func TestListAPI(t *testing.T) {
|
||||
t.Logf("req %v %v, accept: %v", req.Method, req.URL.Path, req.Header["Accept"])
|
||||
|
||||
var err error
|
||||
switch {
|
||||
case req.Method == "GET":
|
||||
switch req.Method {
|
||||
case "GET":
|
||||
// list files in data/
|
||||
res.Header().Set("Content-Type", test.ContentType)
|
||||
_, err = res.Write([]byte(test.Data))
|
||||
@@ -89,7 +89,7 @@ func TestListAPI(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
return
|
||||
case req.Method == "HEAD":
|
||||
case "HEAD":
|
||||
// stat file in data/, use the first two bytes in the name
|
||||
// of the file as the size :)
|
||||
filename := req.URL.Path[6:]
|
||||
|
||||
Reference in New Issue
Block a user