Go-QuerystringGoogle Go 库
Go-Querystring 是 GO 的库,将结构编码至 URL 查询参数中。
示例代码:
type Options struct { Query string `url:"q"`
ShowAll bool `url:"all"`
Page int `url:"page"`}
opt := Options{ "foo", true, 2 }
v, _ := query.Values(opt)
fmt.Print(v.Encode()) // will output: "q=foo&all=true&page=2"评论
