* fix: improve type safety in httpWithTLS for custom RoundTripper
Add type assertion check to handle cases where DefaultHTTPClient.Transport
is a custom http.RoundTripper implementation (not *http.Transport).
This improves upon the fix in PR #844 which only handled nil Transport.
The previous code would still panic if users set a custom RoundTripper:
trans := baseTransport.(*http.Transport).Clone() // panic if not *http.Transport
Now safely handles three scenarios:
1. Transport is nil -> use http.DefaultTransport
2. Transport is *http.Transport -> clone it
3. Transport is custom RoundTripper -> use http.DefaultTransport
Added comprehensive test cases:
- TestHttpWithTLS_NilTransport
- TestHttpWithTLS_CustomTransport
- TestHttpWithTLS_CustomRoundTripper
Related to #803
* refactor: reduce code duplication and complexity in httpWithTLS
- Eliminate duplicate http.DefaultTransport.Clone() calls
- Reduce cyclomatic complexity by simplifying conditional logic
- Use nil check pattern instead of nested else branches
- Maintain same functionality with cleaner code structure
This addresses golangci-lint warnings for dupl and gocyclo.
* fix: add newline at end of http_test.go
Fix gofmt -s compliance issue:
- File must end with newline character
- Addresses golangci-lint gofmt error on line 81
This fixes CI check failure.
* feat: 添加query 以及query单元测试
feat: 添加模板字符串解析以及模板字符串单元测试
* improve: 序列化请求参数,使得参数更易读
* delete: delete useless module
* format: format code
* docs: add function comment
* docs: comment method
* fix: fixed type convert error
* feat: support any type
* feat: support other type
* format: format code
* test: check logger
* format: format code
* test: udpate testing case
* del: remove useless code
* del: remove useless module
* test: update testing case
* ✨ feat: support for unsigned integers
* ✨ feat: template string support any type
* fix payRequset xml marshal: root element should be xml
* support HMAC-SHA256 for unifiedorder api
* support HMAC-SHA256 for PaidVerifySign
* fix SignType is nil
* fix code style
* constantize SignType
* add comments
* fix code style