サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
猛暑に注意を
mholt.github.io
Instantly convert curl commands to Go code This tool turns a curl command into Go code. (To do the reverse, check out moul/http2curl.) Currently, it knows the following options: -d/--data, -H/--header, -I/--head, -u/--user, --url, and -X/--request. It also understands JSON content types (see JSON-to-Go). If the content type is application/x-www-form-urlencoded then it will convert the data to Valu
What It Does Binds http.Request to struct Data validation Error handling Why It Helps Remove binding, validation, and error handling from your application logic Reads the Content-Type to determine for you how to deserialize No middleware: just a function call Use with Negroni, gocraft/web, std lib, etc. How It Looks myStruct := new(MyStruct) errs := binding.Bind(req, myStruct) if errs.Handle(respo
This tool instantly converts JSON into a Go type definition. Paste a JSON structure on the left and the equivalent Go type will be generated to the right, which you can paste into your program. The script has to make some assumptions, so double-check the output! For an example, try converting JSON from the SmartyStreets API or the GitHub API. © 2015 Matt Holt (@mholt6) • View on GitHub • Dark mode
このページを最初にブックマークしてみませんか?
『mholt.github.io』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く