{"id":13646121,"url":"https://github.com/dolmen-go/goproc","last_synced_at":"2026-02-28T18:02:35.658Z","repository":{"id":115746723,"uuid":"160807745","full_name":"dolmen-go/goproc","owner":"dolmen-go","description":"Tool to apply Go templates to JSON/YAML data","archived":false,"fork":false,"pushed_at":"2024-04-30T13:45:28.000Z","size":28,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-23T01:16:41.848Z","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/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":"2018-12-07T10:16:09.000Z","updated_at":"2024-04-30T13:45:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"715b3578-e857-4ab4-90e1-f39db9aa6bc2","html_url":"https://github.com/dolmen-go/goproc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dolmen-go/goproc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolmen-go%2Fgoproc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolmen-go%2Fgoproc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolmen-go%2Fgoproc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolmen-go%2Fgoproc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dolmen-go","download_url":"https://codeload.github.com/dolmen-go/goproc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolmen-go%2Fgoproc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29946463,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T17:57:52.716Z","status":"ssl_error","status_checked_at":"2026-02-28T17:57:31.974Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-08-02T01:02:48.983Z","updated_at":"2026-02-28T18:02:35.640Z","avatar_url":"https://github.com/dolmen-go.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# goproc\n\nApply [Go templates](https://golang.org/pkg/text/template/#hdr-Text_and_spaces) to JSON or YAML data.\n\n## Install\n\n    go install github.com/dolmen-go/goproc@latest\n\n## Usage\n\n    goproc [ -env | -env=true | -env=VAR ] -e \u003cGo-template-text\u003e [ \u003cJSON-or-YAML-file\u003e ]\n    goproc [ -env | -env=true | -env=VAR ] -i \u003cGo-template-file\u003e [ \u003cJSON-or-YAML-file\u003e ]\n\nThe default input is STDIN in JSON format. Use `-yaml` flag to handle STDIN as YAML.\n\nWhen an input file is given, the file extension determines if it is parsed as JSON or YAML.\n\nIn any case there is no magic detection (that usually lead to security issues).\n\n## Template syntax\n\nSee the [Go templates](https://golang.org/pkg/text/template/#hdr-Text_and_spaces) documentation.\n\nThe [Hugo documentation on Go templates](https://gohugo.io/templates/introduction/) may also be useful for a friendlier approach, but note that it contains references to features unique to Hugo (ex: `partial`).\n\n## Functions extensions\n\nThe following functions are available in addition to the [standard functions](https://golang.org/pkg/text/template/#hdr-Functions).\n\n### `env`\n\nAllow to use environment variables, with security protections.\n\nThis function must be explicitely enabled using the `-env` flag:\n\n* `-env`: enables the `env` function. Any environment variable can be used, but listing variables is blocked.\n* `-env=`: enables the `env` function, but whitelist of allowed variables is cleared (no variables allowed).\n* `-env=name1,name2`: enables the `env` function. Only the variables `name1` and `name2` are visible in calls to `env`.\n\nUsage:\n\n    {{ env \"HOME\" }}     {{- /* Get value of HOME environment variable */}}\n    {{ \"HOME\" | env }}   {{- /* Get value of HOME environment variable */}}\n    {{ range $name, $value := env \"HOME\" \"LANG\" -}}\n      {{ $name }}={{ $value }}\n    {{ end }}\n\n\n### `error`\n\nUsage:\n\n    {{ error \"message\" }}\n\nExample:\n\n    echo 0 | goproc -e '{{ error \"fail!\" }}'\n    template: :1:3: executing \"\" at \u003cerror \"fail!\"\u003e: error calling error: fail!\n\n### `jsonptr`\n\nTo ease the extraction of data, `jsonptr` allows to express data location using\nJSON Pointer ([RFC 6901](https://tools.ietf.org/html/rfc6901)).\n\nUsages:\n\n    {{ jsonptr \"pointer\" . }}\n    {{ . | jsonptr \"pointer\" }}\n\n\nExamples:\n\n1. `goproc` [`testdata/02.gotmpl`](testdata/02.gotmpl) [`testdata/02.json`](testdata/02.json)\n2. `goproc` [`testdata/03.gotmpl`](testdata/03.gotmpl) [`testdata/03.json`](testdata/03.json)\n\n### `json`\n\nConvert input to JSON.\n\nUsage:\n\n    {{ json }}\n\nExample:\n\n    echo '{\"data\": [\"x\"]}' | goproc -e '{{.data | json}}{{print \"\\n\"}}'\n    [\"x\"]\n\n### `yaml`\n\nConvert input to YAML.\n\nUsage:\n\n    {{ yaml }}\n\nExample:\n\n    echo '{\"data\": [\"x\"]}' | goproc -e '{{.data | yaml}}'\n    - x\n\n## See also\n\nhttps://github.com/naotookuda/go-template-cli\n\n## License\n\nCopyright 2018-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%2Fgoproc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdolmen-go%2Fgoproc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdolmen-go%2Fgoproc/lists"}