chore: Enable golangci-lint (#7)

This commit is contained in:
Aveline
2025-03-12 14:55:56 +01:00
committed by GitHub
22 changed files with 89 additions and 56 deletions

View File

@@ -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
}