mirror of
https://github.com/luckfox-eng29/kvm.git
synced 2026-01-18 03:28:19 +01:00
chore: Enable golangci-lint (#7)
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"kvm/resource"
|
||||
"net/http"
|
||||
"os"
|
||||
"path"
|
||||
@@ -16,14 +15,12 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"github.com/psanford/httpreadat"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/pion/webrtc/v4"
|
||||
)
|
||||
|
||||
const massStorageName = "mass_storage.usb0"
|
||||
"github.com/jetkvm/kvm/resource"
|
||||
)
|
||||
|
||||
func writeFile(path string, data string) error {
|
||||
return os.WriteFile(path, []byte(data), 0644)
|
||||
@@ -65,11 +62,11 @@ func onDiskMessage(msg webrtc.DataChannelMessage) {
|
||||
func mountImage(imagePath string) error {
|
||||
err := setMassStorageImage("")
|
||||
if err != nil {
|
||||
return fmt.Errorf("Remove Mass Storage Image Error", err)
|
||||
return fmt.Errorf("Remove Mass Storage Image Error: %w", err)
|
||||
}
|
||||
err = setMassStorageImage(imagePath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Set Mass Storage Image Error", err)
|
||||
return fmt.Errorf("Set Mass Storage Image Error: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user