diff --git a/cmd/run.go b/cmd/run.go index e3b19b5..aa7ec62 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -101,7 +101,7 @@ var runCmd = &cobra.Command{ lg := slog.With("backend", shareBackendFlag) - shareURI, err := backend.Apply(ctx, sharePWD, &share.VMShareContext{ + shareURI, err := backend.Apply(sharePWD, &share.VMShareContext{ Instance: i, FileManager: fm, NetTapCtx: tapCtx, diff --git a/nettap/impl.go b/nettap/impl.go index ba16e46..c1e5267 100644 --- a/nettap/impl.go +++ b/nettap/impl.go @@ -30,7 +30,7 @@ type TapManager struct { logger *slog.Logger } -func NewTapManager(logger *slog.Logger) (*TapManager, error) { +func NewTapManager(_ *slog.Logger) (*TapManager, error) { return nil, ErrTapManagerUnimplemented } @@ -38,18 +38,18 @@ func NewUniqueTapName() (string, error) { return "", ErrTapManagerUnimplemented } -func (tm *TapManager) CreateNewTap(tapName string) error { +func (tm *TapManager) CreateNewTap(_ string) error { return ErrTapManagerUnimplemented } -func ValidateTapName(s string) error { +func ValidateTapName(_ string) error { return ErrTapManagerUnimplemented } -func (tm *TapManager) DeleteTap(name string) error { +func (tm *TapManager) DeleteTap(_ string) error { return ErrTapManagerUnimplemented } -func (tm *TapManager) ConfigureNet(tapName string, hostCIDR string) error { +func (tm *TapManager) ConfigureNet(_ string, _ string) error { return ErrTapManagerUnimplemented } diff --git a/osspecifics/osspecifics_darwin.go b/osspecifics/osspecifics_darwin.go index 7d2900d..8266063 100644 --- a/osspecifics/osspecifics_darwin.go +++ b/osspecifics/osspecifics_darwin.go @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -// go:build darwin +//go:build darwin package osspecifics diff --git a/share/afp.go b/share/afp.go index 8fd32ab..33bab32 100644 --- a/share/afp.go +++ b/share/afp.go @@ -17,7 +17,6 @@ package share import ( - "context" "fmt" "net" @@ -48,7 +47,7 @@ func NewAFPBackend(uc *UserConfiguration) (Backend, *VMShareOptions, error) { }, nil } -func (b *AFPBackend) Apply(ctx context.Context, sharePWD string, vc *VMShareContext) (string, error) { +func (b *AFPBackend) Apply(sharePWD string, vc *VMShareContext) (string, error) { err := vc.FileManager.StartAFP(sharePWD) if err != nil { return "", errors.Wrap(err, "start afp server") diff --git a/share/backend.go b/share/backend.go index 425c3f6..056f5fd 100644 --- a/share/backend.go +++ b/share/backend.go @@ -16,12 +16,10 @@ package share -import "context" - type NewBackendFunc func(uc *UserConfiguration) (Backend, *VMShareOptions, error) type Backend interface { - Apply(ctx context.Context, sharePWD string, vc *VMShareContext) (string, error) + Apply(sharePWD string, vc *VMShareContext) (string, error) } var backends = map[string]NewBackendFunc{ diff --git a/share/cfg.go b/share/cfg.go index 7bd9e75..24fdc92 100644 --- a/share/cfg.go +++ b/share/cfg.go @@ -51,16 +51,16 @@ func (rc RawUserConfiguration) Process(backend string, warnLogger *slog.Logger) if backend == "ftp" { if !listenIP.Equal(defaultListenIP) && ftpExtIP.Equal(defaultListenIP) { - slog.Warn("No external FTP IP address via --ftp-extip was configured. This is a requirement in almost all scenarios if you want to connect remotely.") + warnLogger.Warn("No external FTP IP address via --ftp-extip was configured. This is a requirement in almost all scenarios if you want to connect remotely.") } } else { if !ftpExtIP.Equal(defaultListenIP) { - slog.Warn("FTP external IP address specification is ineffective with non-FTP backends", "selected", backend) + warnLogger.Warn("FTP external IP address specification is ineffective with non-FTP backends", "selected", backend) } } if rc.SMBExtMode && backend != "smb" && !IsSMBExtModeDefault() { - slog.Warn("SMB external mode specification is ineffective with non-SMB backends") + warnLogger.Warn("SMB external mode specification is ineffective with non-SMB backends") } return &UserConfiguration{ diff --git a/share/ftp.go b/share/ftp.go index a044ad3..adfae9e 100644 --- a/share/ftp.go +++ b/share/ftp.go @@ -17,7 +17,6 @@ package share import ( - "context" "fmt" "net" @@ -64,7 +63,7 @@ func NewFTPBackend(uc *UserConfiguration) (Backend, *VMShareOptions, error) { }, nil } -func (b *FTPBackend) Apply(ctx context.Context, sharePWD string, vc *VMShareContext) (string, error) { +func (b *FTPBackend) Apply(sharePWD string, vc *VMShareContext) (string, error) { if vc.NetTapCtx != nil { return "", fmt.Errorf("net taps are unsupported in ftp") } diff --git a/share/smb.go b/share/smb.go index 0eb96f0..d54ab63 100644 --- a/share/smb.go +++ b/share/smb.go @@ -17,7 +17,6 @@ package share import ( - "context" "fmt" "net" "strings" @@ -61,7 +60,7 @@ func NewSMBBackend(uc *UserConfiguration) (Backend, *VMShareOptions, error) { }, nil } -func (b *SMBBackend) Apply(ctx context.Context, sharePWD string, vc *VMShareContext) (string, error) { +func (b *SMBBackend) Apply(sharePWD string, vc *VMShareContext) (string, error) { if b.sharePort != nil && vc.NetTapCtx != nil { return "", fmt.Errorf("conflict: configured to use a forwarded port but a net tap configuration was detected") }