{"id":13393499,"url":"https://github.com/sourcegraph/go-diff","last_synced_at":"2025-03-13T19:31:38.304Z","repository":{"id":20232484,"uuid":"23504425","full_name":"sourcegraph/go-diff","owner":"sourcegraph","description":"Unified diff parser and printer for Go","archived":false,"fork":false,"pushed_at":"2024-02-23T16:31:39.000Z","size":178,"stargazers_count":433,"open_issues_count":6,"forks_count":48,"subscribers_count":87,"default_branch":"master","last_synced_at":"2025-03-08T07:36:08.423Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://sourcegraph.com/github.com/sourcegraph/go-diff","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/sourcegraph.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":"2014-08-31T01:51:51.000Z","updated_at":"2025-02-18T02:56:01.000Z","dependencies_parsed_at":"2024-01-13T22:55:13.791Z","dependency_job_id":"f8c310fe-42b2-4e37-8b4a-7e8a479a18d6","html_url":"https://github.com/sourcegraph/go-diff","commit_stats":{"total_commits":90,"total_committers":22,"mean_commits":4.090909090909091,"dds":0.6888888888888889,"last_synced_commit":"1b4d09c1adcb524fc1fa2cb9f027bc9ddf48d3ee"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcegraph%2Fgo-diff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcegraph%2Fgo-diff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcegraph%2Fgo-diff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcegraph%2Fgo-diff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sourcegraph","download_url":"https://codeload.github.com/sourcegraph/go-diff/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243469172,"owners_count":20295700,"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-07-30T17:00:54.363Z","updated_at":"2025-03-13T19:31:37.722Z","avatar_url":"https://github.com/sourcegraph.png","language":"Go","funding_links":[],"categories":["Go","开源类库","Open source library"],"sub_categories":["文本处理","Word Processing"],"readme":"# go-diff [![Build Status](https://travis-ci.org/sourcegraph/go-diff.svg?branch=master)](https://travis-ci.org/sourcegraph/go-diff) [![GoDoc](https://godoc.org/github.com/sourcegraph/go-diff/diff?status.svg)](https://godoc.org/github.com/sourcegraph/go-diff/diff)\n\nDiff parser and printer for Go.\n\nInstalling\n----------\n\n```bash\ngo get -u github.com/sourcegraph/go-diff/diff\n```\n\nUsage\n-----\n\nIt doesn't actually compute a diff. It only reads in (and prints out, given a Go struct representation) unified diff output, such as the following. The corresponding data structure in Go is the `diff.FileDiff` struct.\n\n```diff\n--- oldname\t2009-10-11 15:12:20.000000000 -0700\n+++ newname\t2009-10-11 15:12:30.000000000 -0700\n@@ -1,3 +1,9 @@ Section Header\n+This is an important\n+notice! It should\n+therefore be located at\n+the beginning of this\n+document!\n+\n This part of the\n document has stayed the\n same from version to\n@@ -5,16 +11,10 @@\n be shown if it doesn't\n change.  Otherwise, that\n would not be helping to\n-compress the size of the\n-changes.\n-\n-This paragraph contains\n-text that is outdated.\n-It will be deleted in the\n-near future.\n+compress anything.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcegraph%2Fgo-diff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsourcegraph%2Fgo-diff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcegraph%2Fgo-diff/lists"}