From cac9fe327c9ba7e2617004643c0d9c31768609ab Mon Sep 17 00:00:00 2001 From: Michael Shaw Date: Thu, 19 Jan 2023 17:36:16 -0500 Subject: [PATCH] golang linting is really picky --- utils/json.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/json.go b/utils/json.go index 59746c29..31a4d67c 100644 --- a/utils/json.go +++ b/utils/json.go @@ -7,6 +7,7 @@ package utils import ( "bytes" "errors" + canonicalJson "github.com/gibson042/canonicaljson-go" "github.com/ipfs/go-cid" cbor "github.com/ipfs/go-ipld-cbor" @@ -66,10 +67,9 @@ func GetAttributeAsString(obj map[string]interface{}, attr string) (string, erro } // CIDFromJSONBytesUsingIpldPrime returns CID (dagcbor) for json (as bytes). +// This is combination of samples for unmarshalling and linking +// see: https://pkg.go.dev/github.com/ipld/go-ipld-prime func CIDFromJSONBytesUsingIpldPrime(content []byte) (string, error) { - - //This is combination of samples for unmarshalling and linking - //see: https://pkg.go.dev/github.com/ipld/go-ipld-prime np := basicnode.Prototype.Any // Pick a stle for the in-memory data. nb := np.NewBuilder() // Create a builder. err := dagjson.Decode(nb, bytes.NewReader(content)) // Hand the builder to decoding -- decoding will fill it in! @@ -105,6 +105,6 @@ func CIDFromJSONBytesUsingIpldPrime(content []byte) (string, error) { if err != nil { return "", err } - //return cborcid.String(), nil + // return cborcid.String(), nil return lnk.String(), nil }