{"id":22540600,"url":"https://github.com/dolmen-go/codegen","last_synced_at":"2025-04-09T21:45:15.455Z","repository":{"id":57481018,"uuid":"70197659","full_name":"dolmen-go/codegen","owner":"dolmen-go","description":"Utilities to write Go code generators from text templates","archived":false,"fork":false,"pushed_at":"2025-03-04T13:49:06.000Z","size":34,"stargazers_count":13,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T23:36:13.270Z","etag":null,"topics":["code-generation","go","golang-package","hacktoberfest-accepted"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/dolmen-go/codegen","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dolmen-go.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":"2016-10-06T22:18:23.000Z","updated_at":"2025-03-04T13:49:10.000Z","dependencies_parsed_at":"2024-06-21T04:10:54.665Z","dependency_job_id":null,"html_url":"https://github.com/dolmen-go/codegen","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolmen-go%2Fcodegen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolmen-go%2Fcodegen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolmen-go%2Fcodegen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolmen-go%2Fcodegen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dolmen-go","download_url":"https://codeload.github.com/dolmen-go/codegen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119439,"owners_count":21050754,"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":["code-generation","go","golang-package","hacktoberfest-accepted"],"created_at":"2024-12-07T12:11:32.820Z","updated_at":"2025-04-09T21:45:15.431Z","avatar_url":"https://github.com/dolmen-go.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# codegen - Utilities for Go code generators\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/dolmen-go/codegen.svg)](https://pkg.go.dev/github.com/dolmen-go/codegen)\n[![Codecov](https://codecov.io/gh/dolmen-go/codegen/graph/badge.svg?token=y7mxhgwKi7)](https://codecov.io/gh/dolmen-go/codegen)\n[![Go Report Card](https://goreportcard.com/badge/github.com/dolmen-go/jsonptr)](https://goreportcard.com/report/github.com/dolmen-go/codegen)\n\n\nPackage `codegen` provides a Go API for writing Go code generators from a [`text/template`](https://pkg.go.dev/text/template).\n\n```go\nconst tmpl = `// Code generated by main.go; DO NOT EDIT.\n\npackage main\n\nconst x = {{ printf \"%q\" .str }}\n\nvar v = {{ printf \"%#v\" .array }}\n`\n\nfunc main() {\n\tcodegen.MustParse(tmpl).CreateFile(\n\t\t\"main_gen.go\",\n\t\tmap[string]any{\n\t\t\t\"str\":   `abcdef`,\n\t\t\t\"array\": []int{1, 2, 3},\n\t\t},\n\t)\n}\n```\n\n[Try on the Go Playground](https://go.dev/play/p/CfJBt9ng-4w).\n\nFeatures:\n* The Go syntax is validated before saving.\n* The output properly is reformatted thanks to [`gofmt`](https://pkg.go.dev/go/format).\n* The Go standard for marking generated code (https://golang.org/s/generatedcode) is enforces.\n\nSee [documentation](https://godoc.org/github.com/dolmen-go/codegen) and [example](example_test.go).\n\n\n## License\n\nCopyright 2016-2024 Olivier Mengué\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdolmen-go%2Fcodegen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdolmen-go%2Fcodegen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdolmen-go%2Fcodegen/lists"}