You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before filing a bug, please check whether it has been fixed since the
latest release. Search the issue tracker and check that you're running the
latest version of Go:
Run "go version" and compare against
http://golang.org/doc/devel/release.html If a newer version of Go exists,
install it and retry what you did to reproduce the problem.
Thanks.
What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. Get an attached file test.go
2. go doc test
What is the expected output?
There are variants:
1.
<--------------------------------------------------------->
PACKAGE DOCUMENTATION
package test
import "test"
CONSTANTS
const (
Const1 = 1
Const1
Const2 = 2
Const2
)
const Const3 = 3
Const3
VARIABLES
var (
Var1 int
Var1
Var2 string
Var2
)
var Var3 bool
Var3
<--------------------------------------------------------->
2.
<--------------------------------------------------------->
PACKAGE DOCUMENTATION
package test
import "test"
CONSTANTS
const Const1 = 1
Const1
const Const2 = 2
Const2
const Const3 = 3
Const3
VARIABLES
var Var1 int
Var1
var Var2 string
Var2
var Var3 bool
Var3
<--------------------------------------------------------->
What do you see instead?
<--------------------------------------------------------->
PACKAGE DOCUMENTATION
package test
import "test"
CONSTANTS
const (
// Const1
Const1 = 1
// Const2
Const2 = 2
)
const Const3 = 3
Const3
VARIABLES
var (
// Var1
Var1 int
// Var2
Var2 string
)
var Var3 bool
Var3
<--------------------------------------------------------->
Which compiler are you using (5g, 6g, 8g, gccgo)?
6g
Which operating system are you using?
Linux x86_64
Which version are you using? (run 'go version')
go version devel +1a196137ed09 Tue Apr 09 18:17:55 2013 +1000 linux/amd64
Please provide any additional information below.
Leading newlines in groups are unnecessary too.
This is a fine request, but the current godoc and the supporting go/doc were simply not
designed to produce the documentation in the desired form: A group'ed declaration is
considered a single declaration for documentation purposes. If each of those constants
or variables deserves a comment before the variable/constant, consider making them
separate (ungrouped) declarations. That is, there is work-around, and grouping is
intended to get this effect in the documentation.
Removing the extra blank lines in the groups would be desirable, but in general it's not
clear which blank lines are intended by the author, and so it cannot be solved correctly
all the time. Alternatively, godoc might simply ignore user intent, but that's not the
original intention.
In the long run, we may want to redesign godoc (godoc2) and try different approaches.
by santucco:
Attachments:
The text was updated successfully, but these errors were encountered: