{"id":16305362,"url":"https://github.com/moznion/go-struct-custom-tag-parser","last_synced_at":"2025-12-15T20:34:06.037Z","repository":{"id":144202435,"uuid":"163748964","full_name":"moznion/go-struct-custom-tag-parser","owner":"moznion","description":"A simple parser for golang's custom tags","archived":false,"fork":false,"pushed_at":"2019-01-05T14:07:03.000Z","size":44,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-16T11:11:57.356Z","etag":null,"topics":["custom-tag","golang","parser"],"latest_commit_sha":null,"homepage":null,"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/moznion.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-01T16:05:44.000Z","updated_at":"2024-06-19T06:48:57.478Z","dependencies_parsed_at":"2023-06-18T19:08:44.555Z","dependency_job_id":null,"html_url":"https://github.com/moznion/go-struct-custom-tag-parser","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Fgo-struct-custom-tag-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Fgo-struct-custom-tag-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Fgo-struct-custom-tag-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Fgo-struct-custom-tag-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moznion","download_url":"https://codeload.github.com/moznion/go-struct-custom-tag-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248411958,"owners_count":21099035,"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":["custom-tag","golang","parser"],"created_at":"2024-10-10T21:06:50.650Z","updated_at":"2025-12-15T20:34:00.974Z","avatar_url":"https://github.com/moznion.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"go-struct-custom-tag-parser\n==\n\n[![Build Status](https://travis-ci.org/moznion/go-struct-custom-tag-parser.svg?branch=master)](https://travis-ci.org/moznion/go-struct-custom-tag-parser) [![GoDoc](https://godoc.org/github.com/moznion/go-struct-custom-tag-parser?status.svg)](https://godoc.org/github.com/moznion/go-struct-custom-tag-parser)\n\nA simple parser for golang's struct custom tags.\n\nSTOP!!!!\n--\n\nYou don't have to use this library. You should use [reflect.StructTag](https://golang.org/pkg/reflect/#StructTag) instead of this.\n\nThis library's processing time is slower than reflect's one.\n\n```\ngoos: darwin\ngoarch: amd64\npkg: github.com/moznion/go-struct-custom-tag-parser/author\nBenchmarkParser-4        1000000              1932 ns/op             848 B/op         11 allocs/op\nBenchmarkReflect-4      10000000               140 ns/op               0 B/op          0 allocs/op\nPASS\nok      github.com/moznion/go-struct-custom-tag-parser/author   4.484s\n```\n\n(benchmark code is here: [author/parser_bench_test.go](/author/parser_bench_test.go))\n\n__There is only one reason for using this library, this has a feature to check the syntax of custom tag (in strict mode, `Parse()` returns an error when a custom tag is an invalid syntax).__\n\nSynopsis\n--\n\n### with strict mode\n\nIt raises an error when an unacceptable custom tag is given on parsing.\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/moznion/go-struct-custom-tag-parser\"\n)\n\nfunc main() {\n\tresult, err := tagparser.Parse(`foo:\"bar\" buz:\"qux,foobar\"`, true)\n\tif err != nil {\n\t\tlog.Fatalf(\"unexpected error has come: %s\", err)\n\t}\n\tfmt.Printf(\"%v\\n\", result) // =\u003e map[foo:bar buz:qux,foobar]\n}\n```\n\n### with no strict mode\n\nIt immediately returns the processed results until just before the invalid custom tag syntax. It never raises any error.\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/moznion/go-struct-custom-tag-parser\"\n)\n\nfunc main() {\n\tresult, _ := tagparser.Parse(`foo:\"bar\" buz:\"qux,foobar\"`, false)\n\tfmt.Printf(\"%v\\n\", result) // =\u003e map[foo:bar buz:qux,foobar]\n}\n```\n\nLicense\n--\n\n```\nThe MIT License (MIT)\nCopyright © 2019 moznion, http://moznion.net/ \u003cmoznion@gmail.com\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoznion%2Fgo-struct-custom-tag-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoznion%2Fgo-struct-custom-tag-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoznion%2Fgo-struct-custom-tag-parser/lists"}