{"id":16597370,"url":"https://github.com/cbess/go-textwrap","last_synced_at":"2026-05-20T16:41:06.549Z","repository":{"id":57516662,"uuid":"210502997","full_name":"cbess/go-textwrap","owner":"cbess","description":"Simple and pure Go text/word wrapping port of Python textwrap","archived":false,"fork":false,"pushed_at":"2019-10-29T22:20:17.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-17T04:45:33.299Z","etag":null,"topics":["formatter","golang","textwrap"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cbess.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}},"created_at":"2019-09-24T03:24:03.000Z","updated_at":"2024-11-29T04:52:51.000Z","dependencies_parsed_at":"2022-09-26T18:01:24.814Z","dependency_job_id":null,"html_url":"https://github.com/cbess/go-textwrap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbess%2Fgo-textwrap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbess%2Fgo-textwrap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbess%2Fgo-textwrap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbess%2Fgo-textwrap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cbess","download_url":"https://codeload.github.com/cbess/go-textwrap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242276886,"owners_count":20101528,"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":["formatter","golang","textwrap"],"created_at":"2024-10-11T23:55:38.255Z","updated_at":"2026-05-20T16:41:01.525Z","avatar_url":"https://github.com/cbess.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go Text Wrapping\n\nIt is a lightweight and simple port of the [textwrap](https://docs.python.org/3.6/library/textwrap.html) Python module.\n\n[Soli Deo gloria](https://perfectGod.com)\n\nFeatures:\n\n- Lightweight. Uses only the Go built-in library (no external deps).\n- Simple. Easy to understand code.\n- Counts number of words and characters.\n- Splits (or groups) text based on character limit (width) per group (each wrap).\n- `100%` test coverage.\n- [GoDoc](https://godoc.org/github.com/cbess/go-textwrap) documentation\n\n### Note\n\nIt was only designed to work with English text; it separates words by whitespace.\n\n## Example\n\n```go\nimport (\n    \"fmt\"\n    \"textwrap\"\n)\n\norigText := \"Jesus is God. He Saves by grace through faith alone.\"\nresult, err := textwrap.WordWrap(origText, 10, -1)\nif err != nil {\n    // handle error\n}\n\n// check if max word count exceeded\nif result.IsValid() {\n    // print text groups\n    for idx, text := range result.TextGroups {\n        fmt.Println(\"[\", idx+1, \"]\", text)\n    }\n}\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbess%2Fgo-textwrap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcbess%2Fgo-textwrap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbess%2Fgo-textwrap/lists"}