Convert curl commands to Go code

AppId is over the quota

This tool turns a curl command into Go code. (To do the reverse, check out sethgrid/gencurl.) Currently, it knows the following options: -d/–data, -H/–header, -I/–head, -u/–user, and -X/–request. It also understands JSON content types. As always, be sure to go fmt your code and pay attention to imports. There’s probably bugs; please contribute on GitHub! For a quick way to generate a Go struct from JSON, see JSON-to-Go.

Example 1 · Example 2 · Example 3 · Example 4 · Example 5

© 2016 Matt Holt – View on GitHub

View the original article here

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s