mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Use %w, not %v, in fmt.Errorf, so errors can be unwrapped.
https://go.dev/blog/go1.13-errors#wrapping-errors-with-w
This commit is contained in:
parent
062411143c
commit
bb2126b7c6
2 changed files with 2 additions and 2 deletions
|
@ -79,7 +79,7 @@ func newBrokerChannelFromConfig(config ClientConfig) (*BrokerChannel, error) {
|
||||||
if config.UTLSClientID != "" {
|
if config.UTLSClientID != "" {
|
||||||
utlsClientHelloID, err := utlsutil.NameToUTLSID(config.UTLSClientID)
|
utlsClientHelloID, err := utlsutil.NameToUTLSID(config.UTLSClientID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("unable to create broker channel: %v", err)
|
return nil, fmt.Errorf("unable to create broker channel: %w", err)
|
||||||
}
|
}
|
||||||
utlsConfig := &utls.Config{
|
utlsConfig := &utls.Config{
|
||||||
RootCAs: certs.GetRootCAs(),
|
RootCAs: certs.GetRootCAs(),
|
||||||
|
|
|
@ -147,7 +147,7 @@ func (handler *httpHandler) turbotunnelMode(conn net.Conn, addr net.Addr) error
|
||||||
var clientID turbotunnel.ClientID
|
var clientID turbotunnel.ClientID
|
||||||
_, err := io.ReadFull(conn, clientID[:])
|
_, err := io.ReadFull(conn, clientID[:])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("reading ClientID: %v", err)
|
return fmt.Errorf("reading ClientID: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store a short-term mapping from the ClientID to the client IP
|
// Store a short-term mapping from the ClientID to the client IP
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue