MCPcopy Create free account
hub / github.com/google/go-github / Run

Method Run

tools/metadata/main.go:148–175  ·  view source on GitHub ↗
(root *rootCmd, k *kong.Context)

Source from the content-addressed store, hash-verified

146}
147
148func (c *unusedCmd) Run(root *rootCmd, k *kong.Context) error {
149 _, opsFile, err := root.opsFile()
150 if err != nil {
151 return err
152 }
153 unused, err := unusedOps(opsFile, filepath.Join(root.WorkingDir, "github"))
154 if err != nil {
155 return err
156 }
157 if c.JSON {
158 enc := json.NewEncoder(k.Stdout)
159 enc.SetIndent("", " ")
160 return enc.Encode(unused)
161 }
162 fmt.Fprintf(k.Stdout, "Found %v unused operations\n", len(unused))
163 if len(unused) == 0 {
164 return nil
165 }
166 fmt.Fprintln(k.Stdout, "")
167 for _, op := range unused {
168 fmt.Fprintln(k.Stdout, op.Name)
169 if op.DocumentationURL != "" {
170 fmt.Fprintf(k.Stdout, "doc: %v\n", op.DocumentationURL)
171 }
172 fmt.Fprintln(k.Stdout, "")
173 }
174 return nil
175}
176
177func main() {
178 err := run(os.Args[1:], nil)

Callers

nothing calls this directly

Calls 2

unusedOpsFunction · 0.85
opsFileMethod · 0.80

Tested by

no test coverage detected