From bffe524896c16e009aa3ab132f7c8a0dbcd8bf01 Mon Sep 17 00:00:00 2001 From: Elle Mouton Date: Wed, 9 Jun 2021 14:12:10 +0200 Subject: [PATCH] cmd/frcli: rename csv function to writeToCSV Rename the csv function to writeToCSV so that the csv package can be imported in a future commit without needing to rename the import. --- cmd/frcli/csv.go | 4 ++-- cmd/frcli/node_audit.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/frcli/csv.go b/cmd/frcli/csv.go index 9b21a52..18f81ef 100644 --- a/cmd/frcli/csv.go +++ b/cmd/frcli/csv.go @@ -10,10 +10,10 @@ import ( // CSVHeaders returns the headers used for harmony csv records. var CSVHeaders = "Timestamp,OnChain,Type,Category,Amount(Msat),Amount(%v),TxID,Reference,BTCPrice,BTCTimestamp,Note" -// csv returns a csv string of the values contained in a rpc entry. For ease +// writeToCSV returns a csv string of the values contained in a rpc entry. For ease // of use, the credit field is used to set a negative sign (-) on the amount // of an entry when it decreases our balance (credit=false). -func csv(e *frdrpc.ReportEntry) string { +func writeToCSV(e *frdrpc.ReportEntry) string { amountPrefix := "" if !e.Credit { amountPrefix = "-" diff --git a/cmd/frcli/node_audit.go b/cmd/frcli/node_audit.go index cd7874d..4b7197b 100644 --- a/cmd/frcli/node_audit.go +++ b/cmd/frcli/node_audit.go @@ -204,7 +204,7 @@ func queryOnChainReport(ctx *cli.Context) error { csvStrs := []string{headers} for _, report := range report.Reports { - csvStrs = append(csvStrs, csv(report)) + csvStrs = append(csvStrs, writeToCSV(report)) } csvString := strings.Join(csvStrs, "\n")