From 87e48c9624b39406fb450c639244d52420a7f5e6 Mon Sep 17 00:00:00 2001 From: Nex Zhu <4370605+NexZhu@users.noreply.github.com> Date: Wed, 31 Mar 2021 18:43:26 +0800 Subject: [PATCH] fix: import "math" in generated code for uint8 unmarshalling --- gen.go | 2 ++ testing/cbor_gen.go | 2 ++ testing/cbor_map_gen.go | 2 ++ 3 files changed, 6 insertions(+) diff --git a/gen.go b/gen.go index bf61090..e93e00c 100644 --- a/gen.go +++ b/gen.go @@ -57,6 +57,7 @@ package {{ .Package }} import ( "fmt" "io" + "math" "sort" {{ range .Imports }}{{ .Name }} "{{ .PkgPath }}" @@ -66,6 +67,7 @@ import ( var _ = xerrors.Errorf var _ = cid.Undef +var _ = math.E var _ = sort.Sort `) diff --git a/testing/cbor_gen.go b/testing/cbor_gen.go index d808333..f587961 100644 --- a/testing/cbor_gen.go +++ b/testing/cbor_gen.go @@ -5,6 +5,7 @@ package testing import ( "fmt" "io" + "math" "sort" cid "github.com/ipfs/go-cid" @@ -14,6 +15,7 @@ import ( var _ = xerrors.Errorf var _ = cid.Undef +var _ = math.E var _ = sort.Sort var lengthBufSignedArray = []byte{129} diff --git a/testing/cbor_map_gen.go b/testing/cbor_map_gen.go index 3abb21e..b7d9000 100644 --- a/testing/cbor_map_gen.go +++ b/testing/cbor_map_gen.go @@ -5,6 +5,7 @@ package testing import ( "fmt" "io" + "math" "sort" cid "github.com/ipfs/go-cid" @@ -14,6 +15,7 @@ import ( var _ = xerrors.Errorf var _ = cid.Undef +var _ = math.E var _ = sort.Sort func (t *SimpleTypeTree) MarshalCBOR(w io.Writer) error {