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
cmd/doc: not printing package name in type query #31457
It seems like the package line should be printed always, and there is just a bug in this code path.
There's inconsistency for sure; this one doesn't print the package either:
Should the package always be printed? Maybe. Or maybe just if the arguments don't match the package name?
There's also this, which is annoying. If I run that command in my home directory, not in a module directory, I get a distracting message containing nothing mentioned on the command line:
If no writes to the package buffer happen, then the package clause does not get printed. This is a bug for cases where a file just contains the package clause. We fix this by separating the printing of package clause to a new function and calling it from (*pkgBuffer).Write as well as (*Package).flush. Updates #31457 Change-Id: Ia3bd0ea3963274c460a45d1e37fafc6ee0a197f0 Reviewed-on: https://go-review.googlesource.com/c/go/+/206128 Run-TryBot: Agniva De Sarker <firstname.lastname@example.org> TryBot-Result: Gobot Gobot <email@example.com> Reviewed-by: Rob Pike <firstname.lastname@example.org>