mirror of
https://github.com/lightninglabs/faraday.git
synced 2026-08-16 13:01:10 +02:00
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:
parent
504762194e
commit
bffe524896
2 changed files with 3 additions and 3 deletions
|
|
@ -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 = "-"
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue