Skip to content
Myr

Make sure we pass our mutex by reference

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Christian Rocha · committed by Christian Rocha · parent 65cb46c · Browse files · 1 file+3 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−2 removed

  • other:+3 added−2 removed

1 file+3 added−2 removed

modified:tea.go+3 added-2 removed
98 unmodified lines
99// Program is a terminal user interface.100type Program struct {101 initialModel Model102103 mtx sync.Mutex103 mtx *sync.Mutex104105 output io.Writer // where to send output. this will usually be os.Stdout.106 input io.Reader // this will usually be os.Stdin.107 renderer *renderer
43 unmodified lines
151152// NewProgram creates a new Program.153func NewProgram(model Model, opts ...ProgramOption) *Program {154 p := &Program{155 mtx: &sync.Mutex{},156 initialModel: model,157 output: os.Stdout,158 input: os.Stdin,159 CatchPanics: true,
61 unmodified lines
221 }222 }()223 }224224 p.renderer = newRenderer(p.output, &p.mtx)225 p.renderer = newRenderer(p.output, p.mtx)226227 // Check if output is a TTY before entering raw mode, hiding the cursor and228 // so on.229 {
166 unmodified lines