{"id":17912656,"url":"https://github.com/danielgatis/go-keyval","last_synced_at":"2025-07-01T08:07:38.343Z","repository":{"id":57505629,"uuid":"232013480","full_name":"danielgatis/go-keyval","owner":"danielgatis","description":"A Variadic helper to mimic named arguments.","archived":false,"fork":false,"pushed_at":"2020-09-26T04:34:16.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T07:13:56.913Z","etag":null,"topics":["go","golang","named-arguments","varargs","variadic"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danielgatis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-06T03:02:50.000Z","updated_at":"2022-04-23T07:59:41.000Z","dependencies_parsed_at":"2022-09-19T14:33:08.529Z","dependency_job_id":null,"html_url":"https://github.com/danielgatis/go-keyval","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/danielgatis/go-keyval","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielgatis%2Fgo-keyval","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielgatis%2Fgo-keyval/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielgatis%2Fgo-keyval/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielgatis%2Fgo-keyval/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielgatis","download_url":"https://codeload.github.com/danielgatis/go-keyval/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielgatis%2Fgo-keyval/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262924967,"owners_count":23385460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","named-arguments","varargs","variadic"],"created_at":"2024-10-28T19:46:23.942Z","updated_at":"2025-07-01T08:07:38.310Z","avatar_url":"https://github.com/danielgatis.png","language":"Go","readme":"# go-keyval\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/danielgatis/go-keyval?style=flat-square)](https://goreportcard.com/report/github.com/danielgatis/go-keyval)\n[![License MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/danielgatis/go-keyval/master/LICENSE)\n[![Go Doc](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](https://godoc.org/github.com/danielgatis/go-keyval)\n\nA Variadic helper to mimic named arguments.\n\n## Install\n\n```bash\ngo get -u github.com/danielgatis/go-keyval\n```\n\nAnd then import the package in your code:\n\n```go\nimport \"github.com/danielgatis/go-keyval\"\n```\n\n### Example\n\nAn example described below is one of the use cases.\n\n```go\npackage main\n\nimport (\n  \"fmt\"\n  \"time\"\n\n  \"github.com/danielgatis/go-keyval\"\n)\n\nfunc main() {\n  now := time.Now().UTC()\n  email := \"johndoe@gmail.com\"\n  query := \"select * from users where email = :email and created_at \u003c :created_at\"\n\n  execNamed(query, \"email\", email, \"created_at\", now)\n}\n\nfunc execNamed(query string, args... interface{}) {\n  m := keyval.ToMap(args...)\n  \n  fmt.Printf(\"%s\", m[\"email\"])\n  fmt.Printf(\"%s\", m[\"created_at\"])\n\n  // db stuff here ...\n}\n```\n\n## License\n\nCopyright (c) 2020-present [Daniel Gatis](https://github.com/danielgatis)\n\nLicensed under [MIT License](./LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielgatis%2Fgo-keyval","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielgatis%2Fgo-keyval","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielgatis%2Fgo-keyval/lists"}