PR review feedback

This commit is contained in:
Quentin McGaw
2026-05-19 14:34:47 +00:00
parent f021d8faf8
commit dcbed33a3e
2 changed files with 9 additions and 2 deletions
@@ -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
}
+1 -2
View File
@@ -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) {