go-resty / resty

Simple HTTP and REST client library for Go
MIT License
9.89k stars 696 forks source link

New feature: generate curl cmd for request && some examples that can be tested #728

Open ahuigo opened 11 months ago

ahuigo commented 11 months ago
  1. New feature: generate curl cmd for request.
  2. Examples: they are also unit tests.

Feel free to close this PR if you think these codes are not suitable for merging into the main branch.

jeevatkm commented 10 months ago

@ahuigo Thanks for your PR. Once v3.0.0 RC(s) is somewhat ready, I will return to your PR.

jeevatkm commented 10 months ago

@ahuigo, I'm wondering, can you extract examples that are not related to current PR and create a separate PR targeting branch v2?

ahuigo commented 10 months ago

@ahuigo, I'm wondering, can you extract examples that are not related to current PR and create a separate PR targeting branch v2?

@jeevatkm Of course. Please review this PR(v2): https://github.com/go-resty/resty/pull/734

$ go test -failfast  ./examples
ok      github.com/go-resty/resty/v2/examples   (cached)