Fix linter warnings
This commit is contained in:
parent
1b8a043bea
commit
d33eaf5ac8
8 changed files with 14 additions and 19 deletions
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -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{
|
||||
|
|
|
|||
|
|
@ -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{
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue