func ExampleCommentMap() {
	src := `
package main
const hello = "Hello, World!"  
var foo = hello  
func main() {
	fmt.Println(hello)  
}
`
	fset := token.NewFileSet()  
	f, err := parser.ParseFile(fset, "src.go", src, parser.ParseComments)
	if err != nil {
		panic(err)
	}
	cmap := ast.NewCommentMap(fset, f, f.Comments)
	for i, decl := range f.Decls {
		if gen, ok := decl.(*ast.GenDecl); ok && gen.Tok == token.VAR {
			copy(f.Decls[i:], f.Decls[i+1:])
			f.Decls = f.Decls[:len(f.Decls)-1]
		}
	}
	f.Comments = cmap.Filter(f).Comments()
	var buf bytes.Buffer
	if err := format.Node(&buf, fset, f); err != nil {
		panic(err)
	}
	fmt.Printf("%s", buf.Bytes())
}
This example illustrates how to remove a variable declaration
in a Go program while maintaining correct comment association
using an ast.CommentMap.
package ast_test
import (
	"bytes"
	"fmt"
	"github.com/tcard/sgo/sgo/ast"
	"github.com/tcard/sgo/sgo/format"
	"github.com/tcard/sgo/sgo/parser"
	"github.com/tcard/sgo/sgo/token"
)
func ExampleInspect() {
	src := `
package p
const c = 1.0
var X = f(3.14)*2 + c
`
	fset := token.NewFileSet()  
	f, err := parser.ParseFile(fset, "src.go", src, 0)
	if err != nil {
		panic(err)
	}
	ast.Inspect(f, func(n ast.Node) bool {
		var s string
		switch x := n.(type) {
		case *ast.BasicLit:
			s = x.Value
		case *ast.Ident:
			s = x.Name
		}
		if s != "" {
			fmt.Printf("%s:\t%s\n", fset.Position(n.Pos()), s)
		}
		return true
	})
}
func ExamplePrint() {
	src := `
package main
func main() {
	println("Hello, World!")
}
`
	fset := token.NewFileSet()  
	f, err := parser.ParseFile(fset, "", src, 0)
	if err != nil {
		panic(err)
	}
	ast.Print(fset, f)
}