mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-24 01:26:39 +00:00
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:
@@ -7,6 +7,7 @@ package tshttpproxy
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
@@ -48,7 +49,7 @@ func SetProxyFunc(fn func(*url.URL) (*url.URL, error)) error {
|
|||||||
|
|
||||||
// Allow override only if config is not set
|
// Allow override only if config is not set
|
||||||
if config != nil {
|
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
|
proxyFunc = fn
|
||||||
|
|||||||
Reference in New Issue
Block a user