Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
x/tools/cmd/godoc: "const" declarations with type on right are not grouped with the type #9195
Run the godoc tool on a file such as http://play.golang.org/p/fnp9JT3Ki_. The constants with types on the left of "=" are grouped with the type. The equivalent constants with types on the right are not. Since the two styles of declaration produce equivalent constants, they should arguably also produce equivalent documentation.
Types are trivially recognizable in declarations of the form const c T = x That is not the case in general for declarations of the form const c = x (note that x may have a type). We can probably use a heuristic to handle cases like const c = T(x) but the general case requires type-checking the package.