Skip to content

Conversation

@Kybxd
Copy link
Collaborator

@Kybxd Kybxd commented Jul 18, 2025

No description provided.

@codecov
Copy link

codecov bot commented Jul 18, 2025

Codecov Report

Attention: Patch coverage is 90.52632% with 9 lines in your changes missing coverage. Please review.

Project coverage is 80.19%. Comparing base (a3053fd) to head (a708a3e).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
client.go 84.09% 6 Missing and 1 partial ⚠️
method.go 60.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #46      +/-   ##
==========================================
- Coverage   80.32%   80.19%   -0.13%     
==========================================
  Files           6        7       +1     
  Lines         432      409      -23     
==========================================
- Hits          347      328      -19     
+ Misses         61       59       -2     
+ Partials       24       22       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines 28 to 30
func (r *Request) WithContext(ctx context.Context) *Request {
func (r *Request) WithContext(ctx context.Context) {
r.Request = r.Request.WithContext(ctx)
return r
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No needed?

@wenchy wenchy changed the title feat: allow creating custom clients refator(BREAKING)!: add support to create new requests Client Jul 22, 2025
Comment on lines 15 to 28
func newDefaultClient() *Client {
return &Client{
client: &http.Client{
CheckRedirect: redirector.RedirectPolicyFunc,
},
}
}

func GetDefaultClient() *Client {
once.Do(func() {
defaultClient = newDefaultClient()
})
return defaultClient
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Default client should not be public.
  2. Timeout default to 10s for common use cases.

client.go Outdated
Comment on lines 44 to 45
// WithInterceptor specifies an interceptor for requests made by this client.
// Use `ChainInterceptors` to chain multiple interceptors into one.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Use doc links (see https://tip.golang.org/doc/comment#doclinks):``ChainInterceptors`` -> [ChainInterceptors]
  2. Confusing for requests made by this client. -> for client.

@wenchy wenchy merged commit cbe3a6b into master Jul 23, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants