From da7570a68b91aea909b441adfe01d0a1f73f4065 Mon Sep 17 00:00:00 2001 From: Alessio Perugini Date: Tue, 12 May 2020 17:33:23 +0200 Subject: [PATCH] changed csv data pattern --- storage.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/storage.go b/storage.go index 2d9c27d..c3d2d51 100644 --- a/storage.go +++ b/storage.go @@ -54,8 +54,7 @@ func (p *Peng) ExportToCsv() { currTime := time.Now().Local().String() writer := csv.NewWriter(file) var csvData = [][]string{ - {currTime, "client", fmt.Sprintf("%f", p.ClientTraffic.EntropyTotal())}, - {currTime, "server", fmt.Sprintf("%f", p.ServerTraffic.EntropyTotal())}, + {currTime, fmt.Sprintf("%f", p.ClientTraffic.EntropyTotal()), fmt.Sprintf("%f", p.ServerTraffic.EntropyTotal())}, } // 3. Write all the records err = writer.WriteAll(csvData) // returns error