]> Cypherpunks repositories - gostls13.git/commitdiff
text/template/parse: restore pointer-only receivers for Type on Dot and Nil
authorRob Pike <r@golang.org>
Fri, 29 Aug 2014 17:40:45 +0000 (10:40 -0700)
committerRob Pike <r@golang.org>
Fri, 29 Aug 2014 17:40:45 +0000 (10:40 -0700)
Needless except that the api tool complains. We could fix that issue instead.

TBR=bradfitz
R=golang-codereviews
CC=golang-codereviews
https://golang.org/cl/133290043

src/pkg/text/template/parse/node.go

index e6d661325065e03dc344b5ebcb5c4bbc80e914ef..55c37f6dbacaa76c72873e4263904916119e368e 100644 (file)
@@ -360,6 +360,13 @@ func (t *Tree) newDot(pos Pos) *DotNode {
        return &DotNode{tr: t, NodeType: NodeDot, Pos: pos}
 }
 
+func (d *DotNode) Type() NodeType {
+       // Override method on embedded NodeType for API compatibility.
+       // TODO: Not really a problem; could change API without effect but
+       // api tool complains.
+       return NodeDot
+}
+
 func (d *DotNode) String() string {
        return "."
 }
@@ -383,6 +390,13 @@ func (t *Tree) newNil(pos Pos) *NilNode {
        return &NilNode{tr: t, NodeType: NodeNil, Pos: pos}
 }
 
+func (n *NilNode) Type() NodeType {
+       // Override method on embedded NodeType for API compatibility.
+       // TODO: Not really a problem; could change API without effect but
+       // api tool complains.
+       return NodeNil
+}
+
 func (n *NilNode) String() string {
        return "nil"
 }