diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-04-12 10:54:24 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-04-12 10:54:24 +0900 |
| commit | 0d7c1a9a4356614f035225aeb24e66421879a99b (patch) | |
| tree | c490cfd0f75fbf0218045e277812fb5b6173d4e3 /internal/app/setuid/strings.go | |
| parent | ae6f5ede1928c9d0a2d480b6a924914e8599529f (diff) | |
app: rename app implementation package
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/app/setuid/strings.go')
| -rw-r--r-- | internal/app/setuid/strings.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/internal/app/setuid/strings.go b/internal/app/setuid/strings.go new file mode 100644 index 00000000..f5b51344 --- /dev/null +++ b/internal/app/setuid/strings.go @@ -0,0 +1,19 @@ +package setuid + +import ( + "strconv" + + "git.gensokyo.uk/security/fortify/fst" +) + +func newInt(v int) *stringPair[int] { return &stringPair[int]{v, strconv.Itoa(v)} } +func newID(id *fst.ID) *stringPair[fst.ID] { return &stringPair[fst.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 } |
