shed: gofmt

This commit is contained in:
Łukasz Magiera 2020-09-30 17:26:24 +02:00
parent 6855284d88
commit 6ddea62d09

View File

@ -16,7 +16,7 @@ import (
) )
var datastoreCmd = &cli.Command{ var datastoreCmd = &cli.Command{
Name: "datastore", Name: "datastore",
Description: "access node datastores directly", Description: "access node datastores directly",
Subcommands: []*cli.Command{ Subcommands: []*cli.Command{
datastoreListCmd, datastoreListCmd,
@ -25,19 +25,19 @@ var datastoreCmd = &cli.Command{
} }
var datastoreListCmd = &cli.Command{ var datastoreListCmd = &cli.Command{
Name: "list", Name: "list",
Description: "list datastore keys", Description: "list datastore keys",
Flags: []cli.Flag{ Flags: []cli.Flag{
&cli.IntFlag{ &cli.IntFlag{
Name: "repo-type", Name: "repo-type",
Value: 1, Value: 1,
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "top-level", Name: "top-level",
Usage: "only print top-level keys", Usage: "only print top-level keys",
}, },
&cli.StringFlag{ &cli.StringFlag{
Name: "get-enc", Name: "get-enc",
Usage: "print values [esc/hex/cbor]", Usage: "print values [esc/hex/cbor]",
}, },
}, },
@ -72,8 +72,8 @@ var datastoreListCmd = &cli.Command{
genc := cctx.String("get-enc") genc := cctx.String("get-enc")
q, err := ds.Query(dsq.Query{ q, err := ds.Query(dsq.Query{
Prefix: datastore.NewKey(cctx.Args().Get(1)).String(), Prefix: datastore.NewKey(cctx.Args().Get(1)).String(),
KeysOnly: genc == "", KeysOnly: genc == "",
}) })
if err != nil { if err != nil {
return xerrors.Errorf("datastore query: %w", err) return xerrors.Errorf("datastore query: %w", err)
@ -98,7 +98,6 @@ var datastoreListCmd = &cli.Command{
seen[s] = struct{}{} seen[s] = struct{}{}
} }
s = fmt.Sprintf("%q", s) s = fmt.Sprintf("%q", s)
s = strings.Trim(s, "\"") s = strings.Trim(s, "\"")
fmt.Println(s) fmt.Println(s)
@ -116,15 +115,15 @@ var datastoreListCmd = &cli.Command{
} }
var datastoreGetCmd = &cli.Command{ var datastoreGetCmd = &cli.Command{
Name: "get", Name: "get",
Description: "list datastore keys", Description: "list datastore keys",
Flags: []cli.Flag{ Flags: []cli.Flag{
&cli.IntFlag{ &cli.IntFlag{
Name: "repo-type", Name: "repo-type",
Value: 1, Value: 1,
}, },
&cli.StringFlag{ &cli.StringFlag{
Name: "enc", Name: "enc",
Usage: "encoding (esc/hex/cbor)", Usage: "encoding (esc/hex/cbor)",
Value: "esc", Value: "esc",
}, },