]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/doc: fix copy/paste error in test
authorRob Pike <r@golang.org>
Sat, 20 Jun 2015 19:10:05 +0000 (05:10 +1000)
committerRob Pike <r@golang.org>
Mon, 22 Jun 2015 22:29:35 +0000 (22:29 +0000)
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>
src/cmd/doc/doc_test.go
src/cmd/doc/testdata/pkg.go

index b6eabb32dc6144798b682ec8b67788753c238393..2089002bb80b6e1055c62291a5f009d400d0c598 100644 (file)
@@ -53,9 +53,9 @@ var tests = []test{
                []string{
                        `Package comment`,
                        `const ExportedConstant = 1`,                            // Simple constant.
-                       `ConstOne = 1`,                                          // First entry in constant block.
-                       `const ExportedVariable = 1`,                            // Simple variable.
-                       `VarOne = 1`,                                            // First entry in variable block.
+                       `const ConstOne = 1`,                                    // First entry in constant block.
+                       `var ExportedVariable = 1`,                              // Simple variable.
+                       `var VarOne = 1`,                                        // First entry in variable block.
                        `func ExportedFunc\(a int\) bool`,                       // Function.
                        `type ExportedType struct { ... }`,                      // Exported type.
                        `const ExportedTypedConstant ExportedType = iota`,       // Typed constant.
@@ -63,7 +63,7 @@ var tests = []test{
                },
                []string{
                        `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.
                        `Comment about exported constant`,   // No comment for single constant.
                        `Comment about exported variable`,   // No comment for single variable.
@@ -144,7 +144,7 @@ var tests = []test{
                []string{p, `ExportedVariable`},
                []string{
                        `ExportedVariable`, // Include comment.
-                       `const ExportedVariable = 1`,
+                       `var ExportedVariable = 1`,
                },
                nil,
        },
@@ -154,7 +154,7 @@ var tests = []test{
                []string{`-u`, p, `internalVariable`},
                []string{
                        `Comment about internal variable`, // Include comment.
-                       `const internalVariable = 2`,
+                       `var internalVariable = 2`,
                },
                nil,
        },
index 013cdca679f25c6d43f7ae6d9f877068eea5ac8a..ebefb50b2a100a7f9da470e864e0ddba4a7129ab 100644 (file)
@@ -24,13 +24,13 @@ const (
 // Variables
 
 // Comment about exported variable.
-const ExportedVariable = 1
+var ExportedVariable = 1
 
 // Comment about internal variable.
-const internalVariable = 2
+var internalVariable = 2
 
 // Comment about block of variables.
-const (
+var (
        // Comment before VarOne.
        VarOne   = 1
        VarTwo   = 2 // Comment on line with VarTwo.