Removed fmt.Stringer artistry from all roouter and table structs

This commit is contained in:
Milos Gajdos
2019-07-09 16:17:18 +01:00
parent c5fb409760
commit 23cb811f60
5 changed files with 7 additions and 120 deletions

View File

@@ -10,7 +10,6 @@ import (
"github.com/micro/go-micro/network/router/table"
"github.com/micro/go-micro/registry"
"github.com/olekukonko/tablewriter"
)
const (
@@ -547,23 +546,6 @@ func (r *router) Stop() error {
}
// String prints debugging information about router
func (r *router) String() string {
sb := &strings.Builder{}
table := tablewriter.NewWriter(sb)
table.SetHeader([]string{"ID", "Address", "Network", "Table", "Status"})
data := []string{
r.opts.ID,
r.opts.Address,
r.opts.Network,
fmt.Sprintf("%d", r.opts.Table.Size()),
r.status.Code.String(),
}
table.Append(data)
// render table into sb
table.Render()
return sb.String()
func (r router) String() string {
return "router"
}