mirror of
https://github.com/luckfox-eng29/kvm.git
synced 2026-01-18 03:28:19 +01:00
refactor: update golintci-lint and linter issues
* Update golangci-lint Update golangci-lint to v2. Signed-off-by: SuperQ <superq@gmail.com> * Fixup various linter issues. Signed-off-by: SuperQ <superq@gmail.com> --------- Signed-off-by: SuperQ <superq@gmail.com>
This commit is contained in:
@@ -34,16 +34,17 @@ func (r remoteImageBackend) ReadAt(p []byte, off int64) (n int, err error) {
|
||||
readLen = mountedImageSize - off
|
||||
}
|
||||
var data []byte
|
||||
if source == WebRTC {
|
||||
switch source {
|
||||
case WebRTC:
|
||||
data, err = webRTCDiskReader.Read(ctx, off, readLen)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
n = copy(p, data)
|
||||
return n, nil
|
||||
} else if source == HTTP {
|
||||
case HTTP:
|
||||
return httpRangeReader.ReadAt(p, off)
|
||||
} else {
|
||||
default:
|
||||
return 0, errors.New("unknown image source")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user