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.
This commit is contained in:
Elle Mouton 2021-06-09 14:12:10 +02:00
parent 504762194e
commit bffe524896
No known key found for this signature in database
GPG key ID: D7D916376026F177
2 changed files with 3 additions and 3 deletions

View file

@ -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 = "-"

View file

@ -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")