{"id":44368596,"url":"https://github.com/verils/gotemplate4j","last_synced_at":"2026-05-10T09:14:21.963Z","repository":{"id":45244132,"uuid":"376791803","full_name":"verils/gotemplate4j","owner":"verils","description":"Go template implementation in Java","archived":false,"fork":false,"pushed_at":"2025-05-18T14:21:57.000Z","size":871,"stargazers_count":15,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-21T08:28:30.083Z","etag":null,"topics":["gotemplate","java"],"latest_commit_sha":null,"homepage":"","language":"Java","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/verils.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","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,"zenodo":null}},"created_at":"2021-06-14T10:57:35.000Z","updated_at":"2025-05-18T14:22:04.000Z","dependencies_parsed_at":"2023-11-30T10:28:15.020Z","dependency_job_id":"acd2806e-efa3-49c3-a0cf-52608f785627","html_url":"https://github.com/verils/gotemplate4j","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/verils/gotemplate4j","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verils%2Fgotemplate4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verils%2Fgotemplate4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verils%2Fgotemplate4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verils%2Fgotemplate4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/verils","download_url":"https://codeload.github.com/verils/gotemplate4j/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verils%2Fgotemplate4j/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29341769,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T18:58:20.535Z","status":"ssl_error","status_checked_at":"2026-02-11T18:56:44.814Z","response_time":97,"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":["gotemplate","java"],"created_at":"2026-02-11T19:09:36.598Z","updated_at":"2026-05-10T09:14:21.944Z","avatar_url":"https://github.com/verils.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Golang Template Engine for Java\n\n[![Testing](https://github.com/verils/gotemplate4j/actions/workflows/maven.yml/badge.svg)](https://github.com/verils/gotemplate4j/actions/workflows/maven.yml)\n\n[中文文档](./README_zh.md)\n\nA Go template engine implementation for Java that evaluates Go templates and generates textual output.\n\n\u003e **Purpose**: This project was created not to replace Go templates, but to fill a gap in the Java ecosystem where Go template compatibility was needed. It enables Java applications to leverage Go's powerful template syntax when working with Go-based systems.\n\n\u003e ✅ **Production Ready**: This project has reached production-ready status with stable core functionality, enforced 90%+ instruction coverage, and comprehensive built-in function support.\n\n## Quick Start\n\n### Requirements\n\n- Java Version: \u003e= **1.8**\n- No additional dependencies required (pure Java)\n\n### Installation\n\nAdd the dependency to your Maven project:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.github.verils\u003c/groupId\u003e\n    \u003cartifactId\u003egotemplate4j\u003c/artifactId\u003e\n    \u003cversion\u003e0.6.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Basic Usage\n\n```java\n// Create a user as the input data\nUser user = new User();\nuser.setName(\"Bob\");\n\n// Prepare your template\nTemplate template = new Template(\"demo\");\ntemplate.parse(\"Hello, {{ .Name }}!\");\n\n// Execute and print out the result text\nStringWriter writer = new StringWriter();\ntemplate.execute(writer, user);\nSystem.out.print(writer.toString());  // \"Hello Bob!\"\n```\n\n## Compatibility and Migration\n\nv0.6.0 moves detailed compatibility notes into focused docs:\n\n- [Go Template Compatibility](./docs/go-template-compatibility.md)\n- [Migration from Go text/template](./docs/migration-from-go-template.md)\n\nThe short version: gotemplate4j covers core Go `text/template` control flow, pipelines, template definitions, built-in functions, and execution errors. Java-specific behavior such as JavaBean access, public fields, `Optional`, enums, nulls, missing keys, and map iteration order is documented separately from Go compatibility claims.\n\n## Performance\n\ngotemplate4j is optimized for Java 8 environments. The following baseline metrics were measured on a standard development machine (10,000 iterations):\n\n| Benchmark | Throughput (ops/sec) | Avg Time (ms/op) |\n| :--- | :--- | :--- |\n| **Parse** | ~78,000 | ~0.012 |\n| **Execute** | ~262,000 | ~0.003 |\n| **JavaBean Access** | ~165,000 | ~0.006 |\n| **Map Access** | ~512,000 | ~0.001 |\n| **Range (100 items)** | ~31,000 | ~0.032 |\n| **Function Heavy** | ~474,000 | ~0.002 |\n\n*Note: You can run the `TemplateBenchmark` class in the test suite to verify these numbers on your own hardware.*\n\n### Test Environment\n- **CPU**: Intel i7-10870H 8C16T\n- **Memory**: 64 GB RAM\n- **OS**: Windows 25H2\n- **Java Version**: 1.8\n\n## Roadmap\n\nSee [PLAN.md](./PLAN.md) for the detailed development roadmap.\n\n## References\n\n- [Go text/template Documentation](https://pkg.go.dev/text/template)\n- [Go template Source Code](https://github.com/golang/go/tree/master/src/text/template)\n- [Java Template Engine (Alternative)](https://github.com/proninyaroslav/java-template-engine)\n- [Changelog](./CHANGELOG)\n- [Development Plan](./PLAN.md)\n\n## Contributing\n\nContributions are welcome! Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for detailed guidelines.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fverils%2Fgotemplate4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fverils%2Fgotemplate4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fverils%2Fgotemplate4j/lists"}