Replace .golangci.yml with the shared canonical config. The old config's top-level linters-settings block was silently ignored under the v2 schema, so the lll/funlen/cyclop/dupl thresholds now actually apply. The four repo-specific disables (mnd, exhaustive, paralleltest, testpackage) move out of the config into targeted in-code nolint directives carrying their original approval dates, keeping the config byte-identical to the canonical one. Fixes surfaced by the stricter settings: t.Parallel() added to all 32 tests, 24 overlong lines wrapped or their comments tightened, tcell control-code returns rewritten as character literals, dupl markers on the identically-shaped item data tables, and two wsl_v5 defer cuddles. No behavior changes. The repo has no golangci-lint version pin (no Dockerfile or CI; make lint runs the host binary, currently v2.12.2), so there was nothing to bump.
32 lines
590 B
Go
32 lines
590 B
Go
//nolint:testpackage // white-box tests reach unexported state (approved 2026-07-07)
|
|
package game
|
|
|
|
// testTerm is a headless Terminal for tests: rendering is a no-op and
|
|
// input plays a script, then alternates space/newline so that --More--
|
|
// and [Press return] prompts never block.
|
|
type testTerm struct {
|
|
input []byte
|
|
pos int
|
|
tick int
|
|
}
|
|
|
|
func (t *testTerm) Render(*Window) {}
|
|
|
|
func (t *testTerm) Fini() {}
|
|
|
|
func (t *testTerm) ReadChar() byte {
|
|
if t.pos < len(t.input) {
|
|
c := t.input[t.pos]
|
|
t.pos++
|
|
|
|
return c
|
|
}
|
|
|
|
t.tick++
|
|
if t.tick%2 == 0 {
|
|
return '\n'
|
|
}
|
|
|
|
return ' '
|
|
}
|