From 087959e81bcd52104676ccacedd605e6491b4376 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Thu, 3 Jul 2025 04:11:38 +0900 Subject: app: remove split implementation It is completely nonsensical and highly error-prone to have multiple implementations of this in the same build. This should be switched at compile time instead therefore the split packages are pointless. Signed-off-by: Ophestra --- internal/app/strings_linux.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 internal/app/strings_linux.go (limited to 'internal/app/strings_linux.go') diff --git a/internal/app/strings_linux.go b/internal/app/strings_linux.go new file mode 100644 index 00000000..e4465cee --- /dev/null +++ b/internal/app/strings_linux.go @@ -0,0 +1,19 @@ +package app + +import ( + "strconv" + + "hakurei.app/internal/app/state" +) + +func newInt(v int) *stringPair[int] { return &stringPair[int]{v, strconv.Itoa(v)} } +func newID(id *state.ID) *stringPair[state.ID] { return &stringPair[state.ID]{*id, id.String()} } + +// stringPair stores a value and its string representation. +type stringPair[T comparable] struct { + v T + s string +} + +func (s *stringPair[T]) unwrap() T { return s.v } +func (s *stringPair[T]) String() string { return s.s } -- cgit v1.3.1