code: func FileOptions(f *ast.File) ([]interface{}, error) {
  	var imports = walkImports(f)
  	var options []interface{}
  	var errors []error
  
  	// If the file contains gendoc:ignore, ignore the file
  	for _, c := range f.Comments {
  		if strings.Index(c.Text(), "gendoc:ignore") != -1 {
  			return nil, nil
  		}
  	}
  
  	// Iterate over declarations
  	for i := range f.Decls {
  		ast.Inspect(f.Decls[i], func(x ast.Node) bool {
  			node, ok := x.(*ast.ValueSpec)
  			if !ok {
  				return true
  			}
  
  			for _, v := range node.Values {
  				value, ok := v.(*ast.CompositeLit)
  				if !ok {
  					continue
  				}
  				literalType, ok := value.Type.(*ast.SelectorExpr)
  				if !ok {
  					continue
  				}
  				ident, ok := literalType.X.(*ast.Ident)
  				if !ok {
  					continue
  				}
  				if imports[ident.Name] != "github.com/hyperledger/fabric/common/metrics" {
  					continue
  				}
  				option, err := createOption(literalType)
  				if err != nil {
  					errors = append(errors, err)
  					break
  				}
  				option, err = populateOption(value, option)
  				if err != nil {
  					errors = append(errors, err)
  					break
  				}
  				options = append(options, option)
  			}
  			return false
  		})
  	}
  
  	if len(errors) != 0 {
  		return nil, errors[0]
  	}
  
  	return options, nil
  }
docs: // FileOptions walks the specified ast.File for options structs used when
  // creating metrics and returns instances that are recreated from the source.