diff --git a/go.mod b/go.mod index 3ce45f4..2cfb063 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/jievince/liner v1.2.4-0.20211229025353-9af8863139ef github.com/kr/pretty v0.1.0 // indirect github.com/mattn/go-runewidth v0.0.13 // indirect - github.com/vesoft-inc/nebula-go/v3 v3.4.0-1.0.20230403093312-bf9fe21827d7 + github.com/vesoft-inc/nebula-go/v3 v3.4.0-1.0.20230404054219-3ed89268e97e golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 // indirect gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect diff --git a/go.sum b/go.sum index 99f70d2..60e5b57 100644 --- a/go.sum +++ b/go.sum @@ -39,8 +39,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/vesoft-inc/nebula-go/v3 v3.4.0-1.0.20230403093312-bf9fe21827d7 h1:jk0P5stIdXryHCtHUtPNs/c0aM8akBWaL0FycjCBtAA= -github.com/vesoft-inc/nebula-go/v3 v3.4.0-1.0.20230403093312-bf9fe21827d7/go.mod h1:+sXv05jYQBARdTbTcIEsWVXCnF/6ttOlDK35xQ6m54s= +github.com/vesoft-inc/nebula-go/v3 v3.4.0-1.0.20230404054219-3ed89268e97e h1:vOJo/AEKkDySSzCC8BPJWwSPpsXOvFDrU5VMwWg4q3A= +github.com/vesoft-inc/nebula-go/v3 v3.4.0-1.0.20230404054219-3ed89268e97e/go.mod h1:+sXv05jYQBARdTbTcIEsWVXCnF/6ttOlDK35xQ6m54s= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180816055513-1c9583448a9c/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/printer/dataset_printer.go b/printer/dataset_printer.go index 3be8a7a..45959a6 100644 --- a/printer/dataset_printer.go +++ b/printer/dataset_printer.go @@ -62,7 +62,7 @@ func (p *DataSetPrinter) PrintDataSet(res *nebula.ResultSet) { p.writer.ResetHeaders() p.writer.ResetRows() - if res.IsSetPlanDesc() && res.IsSetData() && "tck" == strings.ToLower(string(res.GetPlanDesc().GetFormat())) { + if res.IsSetPlanDesc() && strings.ToLower(string(res.GetPlanDesc().GetFormat())) == "tck" { configWriterTckStyle(&p.writer) } @@ -102,7 +102,7 @@ func (p *DataSetPrinter) PrintDataSet(res *nebula.ResultSet) { } // Reset the writer style - if res.IsSetPlanDesc() && res.IsSetData() && "tck" == strings.ToLower(string(res.GetPlanDesc().GetFormat())) { + if res.IsSetPlanDesc() && strings.ToLower(string(res.GetPlanDesc().GetFormat())) == "tck" { p.writer.SetStyle(table.StyleDefault) configTableWriter(&p.writer, false) } diff --git a/printer/plan_desc_printer.go b/printer/plan_desc_printer.go index 2c54fb5..00b4df4 100644 --- a/printer/plan_desc_printer.go +++ b/printer/plan_desc_printer.go @@ -149,7 +149,7 @@ func (p *PlanDescPrinter) PrintPlanDesc(res *nebula.ResultSet) { fmt.Println(p.renderDotGraphByStruct(s)) case "tck": rows := res.MakePlanByTck() - s = p.renderByTck(rows) + fmt.Println(p.renderByTck(rows)) // Reset the writer style p.writer.SetStyle(table.StyleDefault) configTableWriter(&p.writer, true)