mirror of
https://github.com/golang/go
synced 2024-09-24 09:30:13 -06:00
cmd/doc: fix copy/paste error in test
Some of those consts were supposed to be vars. Caught by Ingo Oeser. Change-Id: Ifc12e4a8ee61ebf5174e4ad923956c546dc096e2 Reviewed-on: https://go-review.googlesource.com/11296 Reviewed-by: Andrew Gerrand <adg@golang.org>
This commit is contained in:
parent
58d177c63e
commit
cb3e2bf0ba
@ -53,9 +53,9 @@ var tests = []test{
|
|||||||
[]string{
|
[]string{
|
||||||
`Package comment`,
|
`Package comment`,
|
||||||
`const ExportedConstant = 1`, // Simple constant.
|
`const ExportedConstant = 1`, // Simple constant.
|
||||||
`ConstOne = 1`, // First entry in constant block.
|
`const ConstOne = 1`, // First entry in constant block.
|
||||||
`const ExportedVariable = 1`, // Simple variable.
|
`var ExportedVariable = 1`, // Simple variable.
|
||||||
`VarOne = 1`, // First entry in variable block.
|
`var VarOne = 1`, // First entry in variable block.
|
||||||
`func ExportedFunc\(a int\) bool`, // Function.
|
`func ExportedFunc\(a int\) bool`, // Function.
|
||||||
`type ExportedType struct { ... }`, // Exported type.
|
`type ExportedType struct { ... }`, // Exported type.
|
||||||
`const ExportedTypedConstant ExportedType = iota`, // Typed constant.
|
`const ExportedTypedConstant ExportedType = iota`, // Typed constant.
|
||||||
@ -63,7 +63,7 @@ var tests = []test{
|
|||||||
},
|
},
|
||||||
[]string{
|
[]string{
|
||||||
`const internalConstant = 2`, // No internal constants.
|
`const internalConstant = 2`, // No internal constants.
|
||||||
`const internalVariable = 2`, // No internal variables.
|
`var internalVariable = 2`, // No internal variables.
|
||||||
`func internalFunc(a int) bool`, // No internal functions.
|
`func internalFunc(a int) bool`, // No internal functions.
|
||||||
`Comment about exported constant`, // No comment for single constant.
|
`Comment about exported constant`, // No comment for single constant.
|
||||||
`Comment about exported variable`, // No comment for single variable.
|
`Comment about exported variable`, // No comment for single variable.
|
||||||
@ -144,7 +144,7 @@ var tests = []test{
|
|||||||
[]string{p, `ExportedVariable`},
|
[]string{p, `ExportedVariable`},
|
||||||
[]string{
|
[]string{
|
||||||
`ExportedVariable`, // Include comment.
|
`ExportedVariable`, // Include comment.
|
||||||
`const ExportedVariable = 1`,
|
`var ExportedVariable = 1`,
|
||||||
},
|
},
|
||||||
nil,
|
nil,
|
||||||
},
|
},
|
||||||
@ -154,7 +154,7 @@ var tests = []test{
|
|||||||
[]string{`-u`, p, `internalVariable`},
|
[]string{`-u`, p, `internalVariable`},
|
||||||
[]string{
|
[]string{
|
||||||
`Comment about internal variable`, // Include comment.
|
`Comment about internal variable`, // Include comment.
|
||||||
`const internalVariable = 2`,
|
`var internalVariable = 2`,
|
||||||
},
|
},
|
||||||
nil,
|
nil,
|
||||||
},
|
},
|
||||||
|
6
src/cmd/doc/testdata/pkg.go
vendored
6
src/cmd/doc/testdata/pkg.go
vendored
@ -24,13 +24,13 @@ const (
|
|||||||
// Variables
|
// Variables
|
||||||
|
|
||||||
// Comment about exported variable.
|
// Comment about exported variable.
|
||||||
const ExportedVariable = 1
|
var ExportedVariable = 1
|
||||||
|
|
||||||
// Comment about internal variable.
|
// Comment about internal variable.
|
||||||
const internalVariable = 2
|
var internalVariable = 2
|
||||||
|
|
||||||
// Comment about block of variables.
|
// Comment about block of variables.
|
||||||
const (
|
var (
|
||||||
// Comment before VarOne.
|
// Comment before VarOne.
|
||||||
VarOne = 1
|
VarOne = 1
|
||||||
VarTwo = 2 // Comment on line with VarTwo.
|
VarTwo = 2 // Comment on line with VarTwo.
|
||||||
|
Loading…
Reference in New Issue
Block a user