···1212```golang
1313patch, err := os.Open("changes.patch")
1414if err != nil {
1515- log.Fatalf(err)
1515+ log.Fatal(err)
1616}
17171818+// files is a slice of *gitdiff.File describing the files changed in the patch
1919+// preamble is a string of the content of the patch before the first file
1820files, preamble, err := gitdiff.Parse(patch)
1921if err != nil {
2020- log.Fatalf(err)
2222+ log.Fatal(err)
2123}
22242323-// files is a slice of *gitdiff.File describing the files changed in the patch
2424-// preamble is a string of the content of the patch before the first file
2525+code, err := os.Open("code.go")
2626+if err != nil {
2727+ log.Fatal(err)
2828+}
2929+3030+// apply the changes in the patch to a source file
3131+var output bytes.Buffer
3232+if err := gitdiff.NewApplier(code).ApplyFile(&output, files[0]); err != nil {
3333+ log.Fatal(err)
3434+}
2535```
26362737## Development Status