Skip to content

Commit

Permalink
fix CSV local command (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
czpmango authored Apr 27, 2022
1 parent 72c49c0 commit d39aee0
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions printer/dataset_printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,13 @@ func (p *DataSetPrinter) PrintDataSet(res *nebula.ResultSet) {

fmt.Println(p.writer.Render())
if p.fd != nil {
go func() {
s := strings.Replace(p.writer.RenderCSV(), "\\\"", "", -1)
fmt.Fprintln(p.fd, s)
s := strings.Replace(p.writer.RenderCSV(), "\\\"", "", -1)
fmt.Fprintln(p.fd, s)

if err := p.fd.Close(); err != nil {
fmt.Printf("Close file %s failed, %s", p.filename, err.Error())
}
p.fd = nil
p.filename = ""
}()
if err := p.fd.Close(); err != nil {
fmt.Printf("Close file %s failed, %s", p.filename, err.Error())
}
p.fd = nil
p.filename = ""
}
}

0 comments on commit d39aee0

Please sign in to comment.