gonum/unit — pull request #5 by btracey (2014-05-23 04:02:01+00:00)
Title: Add many unit types, fix map bug, and autogen template bug

This PR does two things. First, this fixes a bug where the dimensions would be printed in a random order when using %#v. Second, this adds a number of specific unit types (using the autogenerated templates). Third, this fixes a bug in the templates where a spurious space would be added for types without a string suffix.

This now "GoString" prints the dimensions using their string values rather than their constant numbers. The main reason for this is that two different init() functions may add units. If their execution order isn't specified, different constant numbers may be associated with the user-defined dimension. This would make it hard to consistently use the flag. Secondly, the string of the dimension means much more than the number associated with it, and so practically this behavior is much nicer.