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

Updates tailscale/corp#30668

Signed-off-by: Will Hannah <willh@tailscale.com>
pull/16874/head
Will Hannah 4 months ago committed by GitHub
parent 3f1851a6d9
commit 5b6c64b187
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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

Loading…
Cancel
Save