code: func DocComments(path string) (docs map[string]map[string][]*ast.Comment, err error) {
  	fset := token.NewFileSet()
  	pkgs, err := parser.ParseDir(fset, path, nil, parser.ParseComments)
  	if err != nil {
  		return nil, err
  	}
  
  	docs = make(map[string]map[string][]*ast.Comment)
  	for _, p := range pkgs {
  		for _, f := range p.Files {
  			for _, n := range f.Decls {
  				fn, ok := n.(*ast.FuncDecl)
  				if !ok || fn.Doc == nil {
  					continue
  				}
  
  				var typ string
  				if fn.Recv != nil && len(fn.Recv.List) > 0 {
  					id, ok := fn.Recv.List[0].Type.(*ast.Ident)
  					if ok {
  						typ = id.Name
  					}
  				}
  				doc, ok := docs[typ]
  				if !ok {
  					doc = make(map[string][]*ast.Comment)
  					docs[typ] = doc
  				}
  				doc[fn.Name.String()] = fn.Doc.List
  			}
  		}
  	}
  	return docs, nil
  }
docs: // DocComments returns a map of method documentation comments for the package at the
  // given path. The first key of the returned map is the type name and the second
  // is the method name. Non-method function documentation are in docs[""].