Convert curl commands to Go code in your browser
JavaScript CSS HTML
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 14 commits behind mholt:gh-pages.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


curl-to-Go is a tool to instantly convert curl commands to Go code in the browser. It does not guarantee high-fidelity conversions, but it's good enough for most API docs that have curl samples.

This is a sister tool to JSON-to-Go, which converts JSON to a Go struct type definition.

Try it

Check it out! It works inside your browser. Just give the code a once-over since it will need you to flush out some parts like error handling.


Does any curl command work?

Any curl command should work, but only certain flags are understood and converted into Go code. The rest of the flags will be ignored.

Which kinds of curl commands are understood?

Mostly simple HTTP commands (headers, basic auth, body, etc).

Will you consider supporting this-or-that flag?

curl has like a bajillion options, so don't expect all of them to be implemented; just the most common/important ones to stub out code from API samples and docs, etc. But feel free to open an issue or submit a pull request!


curl-to-Go is brought to you by Matt Holt (mholt6). Enjoy!