title: Format errors in Go - %s %v or %w
body: <p>Both <code>%s</code> and <code>%v</code> can be used to format errors in Go, and there seems to be no functional difference, at least superficially.</p>
  
  <p>We see both in Go's own tools.</p>
  
  <p>In <a href="https://github.com/golang/go/blob/1fb7d5472e8f46faaa034fe6e16ca66a1e7c766f/src/cmd/go/internal/get/path.go#L26" rel="noreferrer">cmd/go/internal/get/path.go</a>:
  <code>return fmt.Errorf("malformed import path %q: %v", path, err)</code></p>
  
  <p>In <a href="https://github.com/golang/go/blob/6a9d850b82172225b55bd65e830b1e325b17a724/src/cmd/go/internal/list/list.go#L355" rel="noreferrer">cmd/go/internal/list/list.go</a>:
  <code>base.Fatalf("%s", err)</code></p>
  
  <p>Should I ever prefer one over the other?</p>