code optimization (#3625)

This commit is contained in:
fatedier
2023-09-20 15:18:50 +08:00
committed by GitHub
parent 5c8ea51eb5
commit 5e70d5bee0
34 changed files with 190 additions and 222 deletions

View File

@@ -90,12 +90,12 @@ func StatusHandler(clientCfg *v1.ClientCommonConfig) error {
fmt.Printf("Proxy Status...\n\n")
for _, typ := range proxyTypes {
arrs := res[typ]
arrs := res[string(typ)]
if len(arrs) == 0 {
continue
}
fmt.Println(strings.ToUpper(typ))
fmt.Println(strings.ToUpper(string(typ)))
tbl := table.New("Name", "Status", "LocalAddr", "Plugin", "RemoteAddr", "Error")
for _, ps := range arrs {
tbl.AddRow(ps.Name, ps.Status, ps.LocalAddr, ps.Plugin, ps.RemoteAddr, ps.Err)