go-vise

Constrained Size Output Virtual Machine
Info | Log | Files | Refs | README | LICENSE

commit 33f4e51c4cc69c470e8a6e09c9a4fd5440c943f7
parent feaab793b2664d77de2f0120ff6647e0e6f6131e
Author: lash <dev@holbrook.no>
Date:   Tue, 18 Apr 2023 15:06:54 +0100

Remove useless stateful resource implementation

Diffstat:
Dresource/state.go | 29-----------------------------
Dresource/state_test.go | 14--------------
2 files changed, 0 insertions(+), 43 deletions(-)

diff --git a/resource/state.go b/resource/state.go @@ -1,29 +0,0 @@ -package resource - -import ( - "git.defalsify.org/vise/state" -) - -type StateResource struct { - Resource - st *state.State -} - -func ToStateResource(rs Resource) *StateResource { - return &StateResource{rs, nil} -} - -func NewStateResource(st *state.State) *StateResource { - return &StateResource { - NewMenuResource(), - st, - } -} - -func(sr *StateResource) WithState(st *state.State) *StateResource { - if sr.st != nil { - panic("state already set") - } - sr.st = st - return sr -} diff --git a/resource/state_test.go b/resource/state_test.go @@ -1,14 +0,0 @@ -package resource - -import ( - "testing" - - "git.defalsify.org/vise/state" -) - -func TestStateResourceInit(t *testing.T) { - st := state.NewState(0) - rs := NewMenuResource() - _ = ToStateResource(rs).WithState(&st) - _ = NewStateResource(&st) -}