@@ -150,32 +150,30 @@ func (r *RootCmd) createProxy() *clibase.Cmd {
150
150
}
151
151
152
152
func (r * RootCmd ) listProxies () * clibase.Cmd {
153
- var (
154
- formatter = cliui .NewOutputFormatter (
155
- cliui .TableFormat ([]codersdk.WorkspaceProxy {}, []string {"name" , "url" , "status status" }),
156
- cliui .JSONFormat (),
157
- cliui .ChangeFormatterData (cliui .TextFormat (), func (data any ) (any , error ) {
158
- resp , ok := data .([]codersdk.WorkspaceProxy )
159
- if ! ok {
160
- return nil , xerrors .Errorf ("unexpected type %T" , data )
153
+ formatter := cliui .NewOutputFormatter (
154
+ cliui .TableFormat ([]codersdk.WorkspaceProxy {}, []string {"name" , "url" , "status status" }),
155
+ cliui .JSONFormat (),
156
+ cliui .ChangeFormatterData (cliui .TextFormat (), func (data any ) (any , error ) {
157
+ resp , ok := data .([]codersdk.WorkspaceProxy )
158
+ if ! ok {
159
+ return nil , xerrors .Errorf ("unexpected type %T" , data )
160
+ }
161
+ var str strings.Builder
162
+ _ , _ = str .WriteString ("Workspace Proxies:\n " )
163
+ sep := ""
164
+ for i , proxy := range resp {
165
+ _ , _ = str .WriteString (sep )
166
+ _ , _ = str .WriteString (fmt .Sprintf ("%d: %s %s %s" , i , proxy .Name , proxy .URL , proxy .Status .Status ))
167
+ for _ , errMsg := range proxy .Status .Report .Errors {
168
+ _ , _ = str .WriteString (color .RedString ("\n \t Err: %s" , errMsg ))
161
169
}
162
- var str strings.Builder
163
- str .WriteString ("Workspace Proxies:\n " )
164
- sep := ""
165
- for i , proxy := range resp {
166
- str .WriteString (sep )
167
- str .WriteString (fmt .Sprintf ("%d: %s %s %s" , i , proxy .Name , proxy .URL , proxy .Status .Status ))
168
- for _ , errMsg := range proxy .Status .Report .Errors {
169
- str .WriteString (color .RedString ("\n \t Err: %s" , errMsg ))
170
- }
171
- for _ , warnMsg := range proxy .Status .Report .Errors {
172
- str .WriteString (color .YellowString ("\n \t Warn: %s" , warnMsg ))
173
- }
174
- sep = "\n "
170
+ for _ , warnMsg := range proxy .Status .Report .Errors {
171
+ _ , _ = str .WriteString (color .YellowString ("\n \t Warn: %s" , warnMsg ))
175
172
}
176
- return str .String (), nil
177
- }),
178
- )
173
+ sep = "\n "
174
+ }
175
+ return str .String (), nil
176
+ }),
179
177
)
180
178
181
179
client := new (codersdk.Client )
0 commit comments