Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions uci/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,19 @@ func New(path string, opts ...func(e *Engine)) (*Engine, error) {
for _, opt := range opts {
opt(e)
}
go func() {
_ = e.cmd.Run()
}()
err = e.cmd.Start()
if err != nil {
return nil, fmt.Errorf("uci: failed to start executable %s: %w", path, err)
}
go e.cmd.Wait()

return e, nil
}

func (e *Engine) Getpid() int {
return e.cmd.Process.Pid
}

// ID returns the id values returned from the most recent CmdUCI invocation. It includes
// key value data such as the following:
// id name Stockfish 12
Expand Down
Loading