set a Base32 default explicitly

This commit is contained in:
laser 2020-06-05 13:52:36 -07:00
parent b167e73acb
commit 963e4dd2fc

View File

@ -196,12 +196,12 @@ func DaemonContext(cctx *cli.Context) context.Context {
return context.Background() return context.Background()
} }
// GetCidEncoder returns an encoder using the cid-base flag if provided, or // GetCidEncoder returns an encoder using the `cid-base` flag if provided, or
// the default (Base32) encoder if not. // the default (Base32) encoder if not.
func GetCidEncoder(cctx *cli.Context) (cidenc.Encoder, error) { func GetCidEncoder(cctx *cli.Context) (cidenc.Encoder, error) {
val := cctx.String("cid-base") val := cctx.String("cid-base")
e := cidenc.Default() e := cidenc.Encoder{Base: multibase.MustNewEncoder(multibase.Base32)}
if val != "" { if val != "" {
var err error var err error