packagecidutilimport(cid"github.com/ipfs/go-cid"mhash"github.com/multiformats/go-multihash")// Inliner is a cid.Builder that will use the id multihash when the// size of the content is no more than limittypeInlinerstruct{cid.BuilderLimitint}// WithCodec implements the cid.Builder interfacefunc(pInliner)WithCodec(cuint64)cid.Builder{returnInliner{p.Builder.WithCodec(c),p.Limit}}// Sum implements the cid.Builder interfacefunc(pInliner)Sum(data[]byte)(*cid.Cid,error){iflen(data)>p.Limit{returnp.Builder.Sum(data)}returncid.V1Builder{Codec:p.GetCodec(),MhType:mhash.ID}.Sum(data)}