]> Cypherpunks repositories - gostls13.git/commitdiff
debug/dwarf, encoding/asn1, go/ast: fix old comments
authorMatthew Dempsky <mdempsky@google.com>
Mon, 23 Mar 2015 22:28:51 +0000 (15:28 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 24 Mar 2015 00:09:30 +0000 (00:09 +0000)
The debug/dwarf and encoding/asn1 examples were added in 2009, a few
months before Go added implicit semicolons, and never updated.

The go/ast node types have always been named just "Expr", "Stmt", and
"Decl", so the comments about "ExprNode", "StmtNode", and "DeclNode"
were likely just mistaken because the interface tag methods are
"exprNode", "stmtNode", and "declNode", respectively.

Change-Id: I9d138cc3a16c1a51453da1406914d7b320bf6270
Reviewed-on: https://go-review.googlesource.com/7980
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/debug/dwarf/entry.go
src/encoding/asn1/marshal.go
src/go/ast/ast.go

index d459f30519cf9d7345f8e518f46326ec9a0d06b5..2742ae0eabfafbb1e9ad2f7d0ae0a008bb1dda49 100644 (file)
@@ -112,7 +112,7 @@ type Field struct {
 //
 // A common idiom is to merge the check for nil return with
 // the check that the value has the expected dynamic type, as in:
-//     v, ok := e.Val(AttrSibling).(int64);
+//     v, ok := e.Val(AttrSibling).(int64)
 //
 func (e *Entry) Val(a Attr) interface{} {
        for _, f := range e.Field {
index b2f104b4cbe56817a5342038b13d31e3b5a80969..bf92c04c9ff6755fff0980c7a5e2c11ad949c119 100644 (file)
@@ -18,7 +18,7 @@ import (
 // A forkableWriter is an in-memory buffer that can be
 // 'forked' to create new forkableWriters that bracket the
 // original.  After
-//    pre, post := w.fork();
+//    pre, post := w.fork()
 // the overall sequence of bytes represented is logically w+pre+post.
 type forkableWriter struct {
        *bytes.Buffer
index d21390ee55c1910f651e55b299617d73768585d1..5ab4283826ba2de45e96a5ee87fd8e14feab23a7 100644 (file)
@@ -486,7 +486,7 @@ func (x *MapType) End() token.Pos       { return x.Value.End() }
 func (x *ChanType) End() token.Pos      { return x.Value.End() }
 
 // exprNode() ensures that only expression/type nodes can be
-// assigned to an ExprNode.
+// assigned to an Expr.
 //
 func (*BadExpr) exprNode()        {}
 func (*Ident) exprNode()          {}
@@ -787,7 +787,7 @@ func (s *ForStmt) End() token.Pos    { return s.Body.End() }
 func (s *RangeStmt) End() token.Pos  { return s.Body.End() }
 
 // stmtNode() ensures that only statement nodes can be
-// assigned to a StmtNode.
+// assigned to a Stmt.
 //
 func (*BadStmt) stmtNode()        {}
 func (*DeclStmt) stmtNode()       {}
@@ -951,7 +951,7 @@ func (d *FuncDecl) End() token.Pos {
 }
 
 // declNode() ensures that only declaration nodes can be
-// assigned to a DeclNode.
+// assigned to a Decl.
 //
 func (*BadDecl) declNode()  {}
 func (*GenDecl) declNode()  {}