From e4f475ee59c0d640bee4c0e0fbf83df402dd0e21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 4 Aug 2020 19:07:31 +0200 Subject: [PATCH] gofmt --- api/test/window_post.go | 3 +-- cli/client.go | 22 +++++++++++----------- lib/tablewriter/tablewiter_test.go | 14 +++++++------- lib/tablewriter/tablewriter.go | 2 +- 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/api/test/window_post.go b/api/test/window_post.go index 1c5c201d9..a31d17825 100644 --- a/api/test/window_post.go +++ b/api/test/window_post.go @@ -4,7 +4,6 @@ import ( "context" "fmt" - "os" "strings" "testing" @@ -81,7 +80,7 @@ func pledgeSectors(t *testing.T, ctx context.Context, miner TestStorageNode, n, s, err := miner.SectorsList(ctx) // Note - the test builder doesn't import genesis sectors into FSM require.NoError(t, err) fmt.Printf("Sectors: %d\n", len(s)) - if len(s) >= n + existing { + if len(s) >= n+existing { break } diff --git a/cli/client.go b/cli/client.go index 2bf2d5c8f..f2cf72f97 100644 --- a/cli/client.go +++ b/cli/client.go @@ -1038,17 +1038,17 @@ var clientListDeals = &cli.Command{ price := types.FIL(types.BigMul(d.LocalDeal.PricePerEpoch, types.NewInt(d.LocalDeal.Duration))) w.Write(map[string]interface{}{ - "DealCid": propcid, - "DealId":d.LocalDeal.DealID, - "Provider":d.LocalDeal.Provider, - "State":dealStateString(color, d.LocalDeal.State), - "On Chain?":onChain, - "Slashed?":slashed, - "PieceCID":piece, - "Size":types.SizeStr(types.NewInt(d.LocalDeal.Size)), - "Price":price, - "Duration":d.LocalDeal.Duration, - "Message":d.LocalDeal.Message, + "DealCid": propcid, + "DealId": d.LocalDeal.DealID, + "Provider": d.LocalDeal.Provider, + "State": dealStateString(color, d.LocalDeal.State), + "On Chain?": onChain, + "Slashed?": slashed, + "PieceCID": piece, + "Size": types.SizeStr(types.NewInt(d.LocalDeal.Size)), + "Price": price, + "Duration": d.LocalDeal.Duration, + "Message": d.LocalDeal.Message, }) } diff --git a/lib/tablewriter/tablewiter_test.go b/lib/tablewriter/tablewiter_test.go index 2dd0c3009..9c5f9d37d 100644 --- a/lib/tablewriter/tablewiter_test.go +++ b/lib/tablewriter/tablewiter_test.go @@ -10,22 +10,22 @@ import ( func TestTableWriter(t *testing.T) { tw := New(Col("C1"), Col("X"), Col("C333"), NewLineCol("Thing")) tw.Write(map[string]interface{}{ - "C1": "234", + "C1": "234", "C333": "ou", }) tw.Write(map[string]interface{}{ - "C1": "23uieui4", - "C333": "ou", - "X": color.GreenString("#"), + "C1": "23uieui4", + "C333": "ou", + "X": color.GreenString("#"), "Thing": "a very long thing, annoyingly so", }) tw.Write(map[string]interface{}{ - "C1": "ttttttttt", + "C1": "ttttttttt", "C333": "eui", }) tw.Write(map[string]interface{}{ - "C1": "1", - "C333": "2", + "C1": "1", + "C333": "2", "SurpriseColumn": "42", }) if err := tw.Flush(os.Stdout); err != nil { diff --git a/lib/tablewriter/tablewriter.go b/lib/tablewriter/tablewriter.go index 5caa5e917..d77611390 100644 --- a/lib/tablewriter/tablewriter.go +++ b/lib/tablewriter/tablewriter.go @@ -45,7 +45,7 @@ func (w *TableWriter) Write(r map[string]interface{}) { // this can cause columns to be out of order, but will at least work byColID := map[int]string{} - cloop: +cloop: for col, val := range r { for i, column := range w.cols { if column.Name == col {