百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
G

go-querystring

> 编程语言
开源

go-querystring 是一个用于将结构体编码为 URL 查询字符串的 Go 库。

2.1K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

go-querystring 是一个用于将结构体编码为 URL 查询字符串的 Go 库。

go-querystring

go-querystring is a Go library for encoding structs into URL query parameters.

Usage

import "github.com/google/go-querystring/query"

go-querystring is designed to assist in scenarios where you want to construct a URL using a struct that represents the URL query parameters. You might do this to enforce the type safety of your parameters, for example, as is done in the go-github library.

The query package exports a single Values() function. A simple example:

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"

See the package godocs for complete documentation on supported types and formatting options.

Alternatives

If you are looking for a library that can both encode and decode query strings, you might consider one of these alternatives:

  • https://github.com/gorilla/schema
  • https://github.com/pasztorpisti/qs
  • https://github.com/hetiansu5/urlquery
  • https://github.com/ggicci/httpin (decoder only)

GitHub Issues· 0 开放

在 GitHub 查看全部

暂无开放 Issues,或尚未同步最近议题。

核心特点

  • •https://github.com/gorilla/schema
  • •https://github.com/pasztorpisti/qs
  • •https://github.com/hetiansu5/urlquery
  • •https://github.com/ggicci/httpin (decoder only)

> 标签

Goquery-stringquerystring

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言