Files
mtusi2026lab3/internal/messenger/model.go
T
dizi b5583a813e
Skeleton contracts / contracts (push) Failing after 40s
Skeleton contracts / contracts (pull_request) Failing after 38s
chore: import lab2 baseline
2026-10-02 15:50:49 +03:00

30 lines
506 B
Go

package messenger
import (
"gitea.privcloud.tech/dizi/mtusi2026lab2/internal/model"
"github.com/google/uuid"
)
type User = model.User
type Chat = model.Chat
type Message = model.Message
func newID() (string, error) {
id, err := uuid.NewRandom()
if err != nil {
return "", err
}
return id.String(), nil
}
func canonicalID(value string) (string, bool) {
if len(value) != 36 {
return "", false
}
id, err := uuid.Parse(value)
if err != nil {
return "", false
}
return id.String(), true
}