{"id":21595277,"url":"https://github.com/euank/gotmpl","last_synced_at":"2025-04-11T00:10:56.170Z","repository":{"id":66058109,"uuid":"51491088","full_name":"euank/gotmpl","owner":"euank","description":"The simplest templating possible, in library and cli form","archived":false,"fork":false,"pushed_at":"2019-01-28T22:09:22.000Z","size":14,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T20:51:12.794Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/euank.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-02-11T03:11:14.000Z","updated_at":"2025-03-13T11:08:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"e1118380-7a84-46e1-91da-6b565bf5247a","html_url":"https://github.com/euank/gotmpl","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/euank%2Fgotmpl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/euank%2Fgotmpl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/euank%2Fgotmpl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/euank%2Fgotmpl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/euank","download_url":"https://codeload.github.com/euank/gotmpl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248317709,"owners_count":21083528,"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":[],"created_at":"2024-11-24T17:35:38.447Z","updated_at":"2025-04-11T00:10:56.155Z","avatar_url":"https://github.com/euank.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gotmpl\n\nA stupid-simple template substitution tool.\n\n## Template language\n\nThis code supports the following three features:\n\n1. `${var}` \u0026mdash; a template variable which will be replaced with the value of `var`\n1. `\\$` \u0026mdash; an escape, which will be replaced with a `$`\n1. `\\\\` \u0026mdash; an escape, which will be replaced with a `\\`\n\nNo other special syntax is supported.\n\n## Usage\n\n### As a CLI tool\n\nBy default, the `gotmpl` cli tool will resolve template variables from the current environment. As an argument, it takes a file to template and prints the result to stdout.\n\nFor example:\n\n```sh\n$ cat input_file\nhello ${VAR}\n\n$ export VAR=world\n\n$ gotmpl input_file\nhello world\n\n$ gotmpl input_file \u003e output_file\n$ cat output_file\nhello world\n\n```\n\n### As a library\n\nA template may be evaluated by providing anything which satisfies the `Lookup` interface. The most trivial thing to use is a go map via the `MapLookup`:\n\n```go\nresult, err := gotmpl.TemplateString(\"foo is ${foo}\", gotmpl.MapLookup(map[string]string{\"foo\": \"value\"}))\n\nfmt.Println(result)\n// Prints: foo is value\n```\n\n# See Also\n\n* [envsubst](https://www.gnu.org/software/gettext/manual/html_node/envsubst-Invocation.html)\n* [Apache Commons StrSubstitutor](https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/text/StrSubstitutor.html)\n* sh\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feuank%2Fgotmpl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feuank%2Fgotmpl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feuank%2Fgotmpl/lists"}