MCPcopy
hub / github.com/go-task/task / NewExecutor

Function NewExecutor

executor.go:94–115  ·  view source on GitHub ↗

NewExecutor creates a new [Executor] and applies the given functional options to it.

(opts ...ExecutorOption)

Source from the content-addressed store, hash-verified

92// NewExecutor creates a new [Executor] and applies the given functional options
93// to it.
94func NewExecutor(opts ...ExecutorOption) *Executor {
95 e := &Executor{
96 Timeout: time.Second * 10,
97 Stdin: os.Stdin,
98 Stdout: os.Stdout,
99 Stderr: os.Stderr,
100 Logger: nil,
101 Compiler: nil,
102 Output: nil,
103 OutputStyle: ast.Output{},
104 TaskSorter: sort.AlphaNumericWithRootTasksFirst,
105 UserWorkingDir: "",
106 fuzzyModel: nil,
107 concurrencySemaphore: nil,
108 taskCallCount: map[string]*int32{},
109 mkdirMutexMap: map[string]*sync.Mutex{},
110 executionHashes: map[string]context.Context{},
111 executionHashesMutex: sync.Mutex{},
112 }
113 e.Options(opts...)
114 return e
115}
116
117// Options loops through the given [ExecutorOption] functions and applies them
118// to the [Executor].

Callers

nothing calls this directly

Calls 1

OptionsMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…