{"id":17147843,"url":"https://github.com/lithammer/dedent","last_synced_at":"2025-05-16T11:05:35.670Z","repository":{"id":29342168,"uuid":"32876186","full_name":"lithammer/dedent","owner":"lithammer","description":"Remove any common leading whitespace from multiline strings","archived":false,"fork":false,"pushed_at":"2024-06-01T11:25:25.000Z","size":44,"stargazers_count":109,"open_issues_count":5,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-09T07:03:55.670Z","etag":null,"topics":["dedent","go"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/lithammer/dedent","language":"Go","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/lithammer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"lithammer"}},"created_at":"2015-03-25T16:15:22.000Z","updated_at":"2025-03-28T09:43:05.000Z","dependencies_parsed_at":"2024-01-01T13:24:35.989Z","dependency_job_id":"fa09a6c1-33ee-468b-9a50-5376fb7ef265","html_url":"https://github.com/lithammer/dedent","commit_stats":{"total_commits":35,"total_committers":4,"mean_commits":8.75,"dds":0.6285714285714286,"last_synced_commit":"c855d971dc156b93e93c7d4e4eeeac33a9251cb2"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lithammer%2Fdedent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lithammer%2Fdedent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lithammer%2Fdedent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lithammer%2Fdedent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lithammer","download_url":"https://codeload.github.com/lithammer/dedent/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254518384,"owners_count":22084374,"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":["dedent","go"],"created_at":"2024-10-14T21:26:15.548Z","updated_at":"2025-05-16T11:05:30.654Z","avatar_url":"https://github.com/lithammer.png","language":"Go","funding_links":["https://github.com/sponsors/lithammer"],"categories":[],"sub_categories":[],"readme":"# Dedent\n\n[![Build Status](https://github.com/lithammer/dedent/workflows/Go/badge.svg)](https://github.com/lithammer/dedent/actions)\n[![Godoc](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/lithammer/dedent)\n\nRemoves common leading whitespace from multiline strings. Inspired by [`textwrap.dedent`](https://docs.python.org/3/library/textwrap.html#textwrap.dedent) in Python.\n\n## Usage / example\n\nImagine the following snippet that prints a multiline string. You want the indentation to both look nice in the code as well as in the actual output.\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/lithammer/dedent\"\n)\n\nfunc main() {\n\ts := `\n\t\tLorem ipsum dolor sit amet,\n\t\tconsectetur adipiscing elit.\n\t\tCurabitur justo tellus, facilisis nec efficitur dictum,\n\t\tfermentum vitae ligula. Sed eu convallis sapien.`\n\tfmt.Println(dedent.Dedent(s))\n\tfmt.Println(\"-------------\")\n\tfmt.Println(s)\n}\n```\n\nTo illustrate the difference, here's the output:\n\n\n```bash\n$ go run main.go\nLorem ipsum dolor sit amet,\nconsectetur adipiscing elit.\nCurabitur justo tellus, facilisis nec efficitur dictum,\nfermentum vitae ligula. Sed eu convallis sapien.\n-------------\n\n\t\tLorem ipsum dolor sit amet,\n\t\tconsectetur adipiscing elit.\n\t\tCurabitur justo tellus, facilisis nec efficitur dictum,\n\t\tfermentum vitae ligula. Sed eu convallis sapien.\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flithammer%2Fdedent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flithammer%2Fdedent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flithammer%2Fdedent/lists"}