mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-11-24 08:46:54 +08:00
refactor(storage): readability improvements (#3703)
Signed-off-by: Ryan Russell <git@ryanrussell.org> Signed-off-by: Ryan Russell <git@ryanrussell.org>
This commit is contained in:
@@ -15,7 +15,7 @@ func TestParseFileIdFromString(t *testing.T) {
|
||||
fidStr1 = "100, 12345678"
|
||||
_, err = ParseFileIdFromString(fidStr1)
|
||||
if err == nil {
|
||||
t.Errorf("%s : needlId invalid syntax", fidStr1)
|
||||
t.Errorf("%s : needleId invalid syntax", fidStr1)
|
||||
}
|
||||
|
||||
fidStr1 = "100,123456789"
|
||||
|
||||
@@ -195,7 +195,7 @@ func parseMultipart(r *http.Request, sizeLimit int64, pu *ParsedUpload) (e error
|
||||
}
|
||||
contentType := part.Header.Get("Content-Type")
|
||||
if contentType != "" && contentType != "application/octet-stream" && mtype != contentType {
|
||||
pu.MimeType = contentType // only return mime type if not deductable
|
||||
pu.MimeType = contentType // only return mime type if not deducible
|
||||
mtype = contentType
|
||||
}
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ func (n *Needle) Append(w backend.BackendStorageFile, version Version) (offset u
|
||||
return
|
||||
}
|
||||
if offset >= MaxPossibleVolumeSize && n.Size.IsValid() {
|
||||
err = fmt.Errorf("Volume Size %d Exeededs %d", offset, MaxPossibleVolumeSize)
|
||||
err = fmt.Errorf("Volume Size %d Exceeded %d", offset, MaxPossibleVolumeSize)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user