Skip to content

Commit

Permalink
Update README.md, fix import
Browse files Browse the repository at this point in the history
  • Loading branch information
VojtechVitek authored Nov 15, 2024
1 parent 77b0ef9 commit b22cf31
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ There are multiple use-cases where this pattern comes handy such as request logg

Set up HTTP client, which sets `User-Agent`, `Authorization` and `TraceID` headers automatically:
```go
import (
"github.com/go-chi/traceid"
)

authClient := http.Client{
Transport: transport.Chain(
http.DefaultTransport,
transport.SetHeader("User-Agent", userAgent),
transport.SetHeader("Authorization", authHeader),
transport.TraceID,
traceid.Transport,
),
Timeout: 15 * time.Second,
}
Expand Down

0 comments on commit b22cf31

Please sign in to comment.