client/web, clientupdate, util/linuxfw, wgengine/magicsock: Use %v verb for errors

Replace %w verb with %v verb when logging errors.
Use %w only for wrapping errors with fmt.Errorf()

Fixes: #9213

Signed-off-by: Craig Rodrigues <rodrigc@crodrigues.org>
This commit is contained in:
Craig Rodrigues 2023-09-02 11:09:38 -07:00 committed by Brad Fitzpatrick
parent d06a75dcd0
commit 8683ce78c2
4 changed files with 6 additions and 5 deletions

View File

@ -457,7 +457,7 @@ func (s *Server) csrfKey() []byte {
// create a new key // create a new key
key := make([]byte, 32) key := make([]byte, 32)
if _, err := rand.Read(key); err != nil { if _, err := rand.Read(key); err != nil {
log.Fatal("error generating CSRF key: %w", err) log.Fatalf("error generating CSRF key: %v", err)
} }
// if running in CGI mode, try to write the newly created key to disk, and exit if it fails. // if running in CGI mode, try to write the newly created key to disk, and exit if it fails.

View File

@ -863,7 +863,7 @@ func (up *Updater) updateLinuxBinary() error {
return err return err
} }
if err := os.Remove(dlPath); err != nil { if err := os.Remove(dlPath); err != nil {
up.Logf("failed to clean up %q: %w", dlPath, err) up.Logf("failed to clean up %q: %v", dlPath, err)
} }
if err := restartSystemdUnit(context.Background()); err != nil { if err := restartSystemdUnit(context.Background()); err != nil {
if errors.Is(err, errors.ErrUnsupported) { if errors.Is(err, errors.ErrUnsupported) {

View File

@ -186,7 +186,7 @@ func NewNfTablesRunner(logf logger.Logf) (*nftablesRunner, error) {
v6err := checkIPv6(logf) v6err := checkIPv6(logf)
if v6err != nil { if v6err != nil {
logf("disabling tunneled IPv6 due to system IPv6 config: %w", v6err) logf("disabling tunneled IPv6 due to system IPv6 config: %v", v6err)
} }
supportsV6 := v6err == nil supportsV6 := v6err == nil
supportsV6NAT := supportsV6 && checkSupportsV6NAT() supportsV6NAT := supportsV6 && checkSupportsV6NAT()

View File

@ -24,6 +24,7 @@
"go4.org/mem" "go4.org/mem"
"golang.org/x/net/ipv4" "golang.org/x/net/ipv4"
"golang.org/x/net/ipv6" "golang.org/x/net/ipv6"
"tailscale.com/disco" "tailscale.com/disco"
"tailscale.com/envknob" "tailscale.com/envknob"
"tailscale.com/health" "tailscale.com/health"
@ -1644,7 +1645,7 @@ func (c *Conn) SetPreferredPort(port uint16) {
c.port.Store(uint32(port)) c.port.Store(uint32(port))
if err := c.rebind(dropCurrentPort); err != nil { if err := c.rebind(dropCurrentPort); err != nil {
c.logf("%w", err) c.logf("%v", err)
return return
} }
c.resetEndpointStates() c.resetEndpointStates()
@ -2276,7 +2277,7 @@ func (c *Conn) rebind(curPortFate currentPortFate) error {
func (c *Conn) Rebind() { func (c *Conn) Rebind() {
metricRebindCalls.Add(1) metricRebindCalls.Add(1)
if err := c.rebind(keepCurrentPort); err != nil { if err := c.rebind(keepCurrentPort); err != nil {
c.logf("%w", err) c.logf("%v", err)
return return
} }