Remove unused parser resource plumbing

This commit is contained in:
2026-11-07 15:51:19 +00:00
parent f2822f055c
commit 51a147a6e5
10 changed files with 32 additions and 73 deletions

View File

@@ -1,9 +1,7 @@
package cobra
import (
"context"
"fmt"
"io"
"testing"
)
@@ -11,7 +9,7 @@ func BenchmarkPerformanceParse(b *testing.B) {
wide := performanceFlatTree(128)
wideArgs := []string{"wide127"}
deep, deepArgs := performanceNestedTree(24)
options := ParseOptions{Context: context.Background(), Out: io.Discard, Err: io.Discard}
options := ParseOptions{}
for _, benchmark := range []struct {
name string
@@ -41,7 +39,7 @@ func BenchmarkPerformanceParse(b *testing.B) {
func BenchmarkPerformanceSessionParseAndHelp(b *testing.B) {
root := performanceFlatTree(8)
args := []string{"wide007"}
session := Prepare(root, ParseOptions{Context: context.Background(), Out: io.Discard, Err: io.Discard})
session := Prepare(root, ParseOptions{})
result := session.Parse(args)
if result.Failure != nil {
b.Fatalf("fixture parse failed: %s", result.Failure.Message)