From 7730daf1b0d8ddeb29c682a9f70957bbfc9ef70b Mon Sep 17 00:00:00 2001 From: Faye Amacker <33205765+fxamacker@users.noreply.github.com> Date: Sat, 7 Sep 2024 20:24:51 -0500 Subject: [PATCH] Make tinygo use MapIter.Key() & MapIter.Value() tinygo v0.33 doesn't support Value.SetIterKey() and Value.SetIterValue(), which are in go1.20 and newer. This commit adds tinygo build tag to use MapIter.Key() and MapIter.Value() instead to iterate map elements using reflect. --- encode_map.go | 2 +- encode_map_go117.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/encode_map.go b/encode_map.go index 8b4b4bb..0ac63a1 100644 --- a/encode_map.go +++ b/encode_map.go @@ -1,7 +1,7 @@ // Copyright (c) Faye Amacker. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -//go:build go1.20 +//go:build go1.20 && !tinygo package cbor diff --git a/encode_map_go117.go b/encode_map_go117.go index 31c3933..e06b0cd 100644 --- a/encode_map_go117.go +++ b/encode_map_go117.go @@ -1,7 +1,7 @@ // Copyright (c) Faye Amacker. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -//go:build !go1.20 +//go:build !go1.20 || tinygo package cbor