Skip to content

Commit c9f36de

Browse files
committed
lint: remove redundant default encoding assignment
`Parse` already does this internally, which is where our `req` is derived from.
1 parent 6e8d6f4 commit c9f36de

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

cli/run.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ func Run(ctx context.Context, root *cmds.Command,
9999
return nil
100100
}
101101

102-
cmd := req.Command
103-
104102
env, err := buildEnv(req.Context, req)
105103
if err != nil {
106104
printErr(err)
@@ -116,14 +114,6 @@ func Run(ctx context.Context, root *cmds.Command,
116114
return err
117115
}
118116

119-
encTypeStr, _ := req.Options[cmds.EncLong].(string)
120-
encType := cmds.EncodingType(encTypeStr)
121-
122-
// use JSON if text was requested but the command doesn't have a text-encoder
123-
if _, ok := cmd.Encoders[encType]; encType == cmds.Text && !ok {
124-
req.Options[cmds.EncLong] = cmds.JSON
125-
}
126-
127117
re, err := NewResponseEmitter(stdout, stderr, req)
128118
if err != nil {
129119
printErr(err)

0 commit comments

Comments
 (0)