From b685508cca18bd2aedf56c807a230eb226f581b7 Mon Sep 17 00:00:00 2001 From: knqyf263 Date: Fri, 1 Mar 2024 23:31:06 +0400 Subject: [PATCH] fix: exclude uuid for TinyGo Signed-off-by: knqyf263 --- pkg/uuid/uuid.go | 4 +++- pkg/uuid/uuid_tinygo.go | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 pkg/uuid/uuid_tinygo.go diff --git a/pkg/uuid/uuid.go b/pkg/uuid/uuid.go index abea458cf7d7..0b7c74549b7f 100644 --- a/pkg/uuid/uuid.go +++ b/pkg/uuid/uuid.go @@ -1,3 +1,5 @@ +//go:build !tinygo.wasm + package uuid import ( @@ -28,6 +30,6 @@ func SetFakeUUID(t *testing.T, format string) { }) } -func New() uuid.UUID { +func New() UUID { return newUUID() } diff --git a/pkg/uuid/uuid_tinygo.go b/pkg/uuid/uuid_tinygo.go new file mode 100644 index 000000000000..fe328cea9282 --- /dev/null +++ b/pkg/uuid/uuid_tinygo.go @@ -0,0 +1,13 @@ +//go:build tinygo.wasm + +package uuid + +// TinyGo doesn't work with github.com/google/uuid + +type UUID string + +func (UUID) String() string { return "" } + +const Nil = "" + +func New() UUID { return "" }