mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-21 10:27:30 +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 (
|
||||
"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
|
||||
|
Reference in New Issue
Block a user