net/tshttpproxy: use errors.New for error creation (#16860)

Updates tailscale/corp#30668

Signed-off-by: Will Hannah <willh@tailscale.com>
This commit is contained in:
Will Hannah
2025-08-15 06:11:27 -07:00
committed by GitHub
parent 3f1851a6d9
commit 5b6c64b187

View File

@@ -7,6 +7,7 @@ package tshttpproxy
import (
"context"
"errors"
"fmt"
"log"
"net"
@@ -48,7 +49,7 @@ func SetProxyFunc(fn func(*url.URL) (*url.URL, error)) error {
// Allow override only if config is not set
if config != nil {
return fmt.Errorf("tshttpproxy: SetProxyFunc can only be called when config is not set")
return errors.New("tshttpproxy: SetProxyFunc can only be called when config is not set")
}
proxyFunc = fn