···11# go-gitdiff
2233+[](http://godoc.org/github.com/bluekeyes/go-gitdiff/gitdiff)
44+35A Go library for parsing and applying patches generated by `git diff`, `git
46show`, and `git format-patch`. It can also parse and apply unified diffs
57generated by the standard `diff` tool.
6877-It supports both standard line-oriented / text patches and Git binary patches.
99+It supports both standard line-oriented text patches and Git binary patches.
1010+1111+```golang
1212+patch, err := os.Open("changes.patch")
1313+if err != nil {
1414+ log.Fatalf(err)
1515+}
1616+1717+files, preamble, err := gitdiff.Parse(patch)
1818+if err != nil {
1919+ log.Fatalf(err)
2020+}
2121+2222+// files is a slice of *gitdiff.File describing the files changed in the patch
2323+// preamble is a string of the content of the patch before the first file
2424+```
825926## Status
10271111-In development, most functionality is currently missing, incomplete, or broken.
2828+In development, expect API changes. Patch parsing works, but has not been
2929+tested extensively against real-world patches. Patch application has not been
3030+implemented yet.
12311332## Why another git/unified diff parser?
1433