diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-11-13 07:08:07 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-11-13 07:14:16 +0900 |
| commit | abeb67964f52f245f7d529e4dfe01f8347932bfd (patch) | |
| tree | b2e00cedab6721261098dee789360571bdefa0cf /internal/store/data_test.go | |
| parent | bf5d10743f82ea438b1a05939f55d8b0027e98b9 (diff) | |
treewide: document linkname uses
These provide justification for each use of linkname. Poorly thought out uses of linkname are removed.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/store/data_test.go')
| -rw-r--r-- | internal/store/data_test.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/internal/store/data_test.go b/internal/store/data_test.go index 62fd3c9a..fe0e2124 100644 --- a/internal/store/data_test.go +++ b/internal/store/data_test.go @@ -27,7 +27,7 @@ func TestEntryData(t *testing.T) { return buf.String() } } - templateStateGob := mustEncodeGob(newTemplateState()) + templateStateGob := mustEncodeGob(NewTemplateState()) testCases := []struct { name string @@ -45,11 +45,11 @@ func TestEntryData(t *testing.T) { Step: "validate configuration", Err: hst.ErrConfigNull, Msg: "invalid configuration"}}, - {"inconsistent enablement", "\x00\xff\xca\xfe\x00\x00\xff\x00" + templateStateGob, newTemplateState(), &hst.AppError{ + {"inconsistent enablement", "\x00\xff\xca\xfe\x00\x00\xff\x00" + templateStateGob, NewTemplateState(), &hst.AppError{ Step: "validate state enablement", Err: os.ErrInvalid, Msg: "state entry aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa has unexpected enablement byte 0xd, 0xff"}}, - {"template", "\x00\xff\xca\xfe\x00\x00\x0d\xf2" + templateStateGob, newTemplateState(), nil}, + {"template", "\x00\xff\xca\xfe\x00\x00\x0d\xf2" + templateStateGob, NewTemplateState(), nil}, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { @@ -105,7 +105,7 @@ func TestEntryData(t *testing.T) { t.Run("encode fault", func(t *testing.T) { t.Parallel() - s := newTemplateState() + s := NewTemplateState() t.Run("gob", func(t *testing.T) { var want = &hst.AppError{Step: "encode state body", Err: stub.UniqueError(0xcafe)} @@ -123,8 +123,8 @@ func TestEntryData(t *testing.T) { }) } -// newTemplateState returns the address of a new template [hst.State] struct. -func newTemplateState() *hst.State { +// NewTemplateState returns the address of a new template [hst.State] struct. +func NewTemplateState() *hst.State { return &hst.State{ ID: hst.ID(bytes.Repeat([]byte{0xaa}, len(hst.ID{}))), PID: 0xcafe, |
