summaryrefslogtreecommitdiff
path: root/src/cmd/godoc/snippet.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/godoc/snippet.go')
-rwxr-xr-xsrc/cmd/godoc/snippet.go6
1 files changed, 0 insertions, 6 deletions
diff --git a/src/cmd/godoc/snippet.go b/src/cmd/godoc/snippet.go
index c5f4c1edf..626b01455 100755
--- a/src/cmd/godoc/snippet.go
+++ b/src/cmd/godoc/snippet.go
@@ -16,13 +16,11 @@ import (
"fmt"
)
-
type Snippet struct {
Line int
Text []byte
}
-
func newSnippet(fset *token.FileSet, decl ast.Decl, id *ast.Ident) *Snippet {
// TODO instead of pretty-printing the node, should use the original source instead
var buf1 bytes.Buffer
@@ -35,7 +33,6 @@ func newSnippet(fset *token.FileSet, decl ast.Decl, id *ast.Ident) *Snippet {
return &Snippet{fset.Position(id.Pos()).Line, buf2.Bytes()}
}
-
func findSpec(list []ast.Spec, id *ast.Ident) ast.Spec {
for _, spec := range list {
switch s := spec.(type) {
@@ -58,7 +55,6 @@ func findSpec(list []ast.Spec, id *ast.Ident) ast.Spec {
return nil
}
-
func genSnippet(fset *token.FileSet, d *ast.GenDecl, id *ast.Ident) *Snippet {
s := findSpec(d.Specs, id)
if s == nil {
@@ -71,7 +67,6 @@ func genSnippet(fset *token.FileSet, d *ast.GenDecl, id *ast.Ident) *Snippet {
return newSnippet(fset, dd, id)
}
-
func funcSnippet(fset *token.FileSet, d *ast.FuncDecl, id *ast.Ident) *Snippet {
if d.Name != id {
return nil // declaration doesn't contain id - exit gracefully
@@ -83,7 +78,6 @@ func funcSnippet(fset *token.FileSet, d *ast.FuncDecl, id *ast.Ident) *Snippet {
return newSnippet(fset, dd, id)
}
-
// NewSnippet creates a text snippet from a declaration decl containing an
// identifier id. Parts of the declaration not containing the identifier
// may be removed for a more compact snippet.