MCPcopy Index your code
hub / github.com/google/go-github / main

Function main

github/gen-accessors.go:83–127  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

81}
82
83func main() {
84 flag.Parse()
85
86 // For debugging purposes, processing just a single or a few files is helpful:
87 var processOnly map[string]bool
88 if *verbose { // Only create the map if args are provided.
89 for _, arg := range flag.Args() {
90 if processOnly == nil {
91 processOnly = map[string]bool{}
92 }
93 processOnly[arg] = true
94 }
95 }
96
97 fset := token.NewFileSet()
98
99 pkgs, err := parser.ParseDir(fset, ".", sourceFilter, 0)
100 if err != nil {
101 log.Fatal(err)
102 return
103 }
104
105 for pkgName, pkg := range pkgs {
106 t := &templateData{
107 filename: pkgName + fileSuffix,
108 Year: 2017,
109 Package: pkgName,
110 Imports: map[string]string{},
111 }
112 for filename, f := range pkg.Files {
113 if *verbose && processOnly != nil && !processOnly[filename] {
114 continue
115 }
116
117 logf("Processing %v...", filename)
118 if err := t.processAST(f); err != nil {
119 log.Fatal(err)
120 }
121 }
122 if err := t.dump(); err != nil {
123 log.Fatal(err)
124 }
125 }
126 logf("Done.")
127}
128
129func (t *templateData) processAST(f *ast.File) error {
130 for _, decl := range f.Decls {

Callers

nothing calls this directly

Calls 3

processASTMethod · 0.95
dumpMethod · 0.95
logfFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…