qs:Go结构的URL查询参数

时间:2021-05-22 00:06:01
【文件属性】:
文件名称:qs:Go结构的URL查询参数
文件大小:8KB
文件格式:ZIP
更新时间:2021-05-22 00:06:01
Go s 软件包qs将结构编码为URL查询字符串。 它使用反射和Go结构标签(例如encoding / json包)来标识字段名称和编码选项。 系统地构造URL查询参数时非常方便。 它只公开了一个返回net/url.Values 。 浏览上的: 例子 import "github.com/ahmetalpbalkan/qs" ... type SearchParams struct { Query string `qs:"q"` Count int `qs:"num,omitempty"` Start int `qs:"start,omitempty"` } params := SearchParams { Query : "apple pie" , Count : 30 } addr := & url. URL { Schema : "https" ,
【文件预览】:
qs-master
----qs_test.go(4KB)
----qs.go(2KB)
----example_test.go(382B)
----LICENSE(11KB)
----.gitignore(295B)
----README.md(1KB)

网友评论