From ad0034b09aaa76aca478304518c1394ba292a619 Mon Sep 17 00:00:00 2001 From: Ophestra Umiker Date: Sun, 20 Oct 2024 00:07:48 +0900 Subject: 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 --- internal/app/id.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'internal/app/id.go') 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 } -- cgit v1.3.1