MCPcopy
hub / github.com/spf13/cobra / BenchmarkGenYamlToFile

Function BenchmarkGenYamlToFile

doc/yaml_docs_test.go:86–100  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

84}
85
86func BenchmarkGenYamlToFile(b *testing.B) {
87 file, err := os.CreateTemp("", "")
88 if err != nil {
89 b.Fatal(err)
90 }
91 defer os.Remove(file.Name())
92 defer file.Close()
93
94 b.ResetTimer()
95 for i := 0; i < b.N; i++ {
96 if err := GenYaml(rootCmd, file); err != nil {
97 b.Fatal(err)
98 }
99 }
100}

Callers

nothing calls this directly

Calls 2

GenYamlFunction · 0.85
NameMethod · 0.80

Tested by

no test coverage detected