mirror of
https://github.com/qdm12/gluetun.git
synced 2026-07-22 10:26:26 +02:00
PR review feedback
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package settings
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
@@ -24,6 +25,13 @@ func (s Socks5) validate() (err error) {
|
||||
return fmt.Errorf("server listening address is not valid: %w", err)
|
||||
}
|
||||
|
||||
switch {
|
||||
case *s.Username != "" && *s.Password == "":
|
||||
return errors.New("password must be set if username is set")
|
||||
case *s.Username == "" && *s.Password != "":
|
||||
return errors.New("username must be set if password is set")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -35,11 +35,10 @@ func (l *Loop) Start(_ context.Context) (runError <-chan error, err error) {
|
||||
|
||||
runDone := make(chan error)
|
||||
l.runDone = runDone
|
||||
runErrorCh := make(chan error)
|
||||
|
||||
go run(runCtx, runDone, l.settings)
|
||||
|
||||
return runErrorCh, nil
|
||||
return nil, nil //nolint:nilnil
|
||||
}
|
||||
|
||||
func run(ctx context.Context, done chan<- error, settings Settings) {
|
||||
|
||||
Reference in New Issue
Block a user