aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/app/id.go
diff options
context:
space:
mode:
authorOphestra Umiker <cat@ophivana.moe>2024-10-20 00:07:48 +0900
committerOphestra Umiker <cat@ophivana.moe>2024-10-20 00:22:18 +0900
commitad0034b09aaa76aca478304518c1394ba292a619 (patch)
tree07fc40ae14d9eecb368997688c0de1eb1e89cb15 /internal/app/id.go
parent1da845d78bdd6be03e771958100d388b3e6e9fcc (diff)
app: move app ID to app struct
App ID is inherent to App, and it makes no sense to generate it as part of the app sealing process. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
Diffstat (limited to 'internal/app/id.go')
-rw-r--r--internal/app/id.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/internal/app/id.go b/internal/app/id.go
index e996a3a6..6ca48312 100644
--- a/internal/app/id.go
+++ b/internal/app/id.go
@@ -5,14 +5,13 @@ import (
"encoding/hex"
)
-type appID [16]byte
+type ID [16]byte
-func (a *appID) String() string {
+func (a *ID) String() string {
return hex.EncodeToString(a[:])
}
-func newAppID() (*appID, error) {
- a := &appID{}
- _, err := rand.Read(a[:])
- return a, err
+func newAppID(id *ID) error {
+ _, err := rand.Read(id[:])
+ return err
}