daviddengcn/go-diff — pull request #4 by shurcooL (2014-10-12 18:34:23+00:00)
Title: Add godiff.ExecWriter that works on already-parsed Go files, improve and clean up code.

I needed to add a way to get the diff of two _already parsed_ `ast.File`s, and it was not possible with current API. `Exec` takes non-parsed Go filenames, and `Diff` expects `FileInfo` objects with unexported `f`, `fs` fields, and unexported `collect` method call.

That's why I added `ExecWriter`. I used it to implement a little experimental tool that displays semantic diff of Go package at 2 revisions, which you can see [here](https://github.com/shurcooL/play/blob/693f907fbb9667d30ecc11638d21e53bf6776d23/48/main.go#L76-L109).

In the process, I've cleaned up and improved various aspects of the code to be nicer and more like Go standard library. The API is now actually readable. Before:

http://godoc.org/github.com/daviddengcn/go-diff/cmd

After this PR:

http://godoc.org/github.com/shurcooL/go-diff/cmd

So the biggest change is in that one commit 2b8f037e7efd2b1f92f07c51f7afe5f441dc64a5. All other commits are small.

This change (in a less nice way) was sitting uncommitted on my hard-drive for the last couple of months and it's been really annoying me, so I decided to commit it and make a PR.