A diff tool for Go languange. It shows the semantic differences between two Go source files.
Ignored Difference
Order of import statements
Order of definitions of global type/const/var/func
Whether more than one parameters or global variables are declared in one line. e.g. var a, b int = 1, 2 is equivalent to var a int = 1; var b int = 2. (NOTE parallel assignments are not normalized)
All comments.
Code formats. e.g. some useless new lines.
Other Features
Smart matching algorithm on go ast tree.
If a function is deleted or added as a whole, only one-line message is shown (starting by === or ###)
Easily see which function or type, etc. the difference is in.
Import/const/var/func diffrences are shown in order, independent of the lines' order in the source.
Token based line-line difference presentation.
Installation
$ go get -u github.com/daviddengcn/go-diff
$ go install github.com/daviddengcn/go-diff
$ go-diff <new-file> <org-file>