This commit is contained in:
neilotoole 2022-12-30 10:28:01 -07:00
parent 19aa8c76ff
commit 433d83d5b2
2 changed files with 4 additions and 6 deletions

View File

@ -585,7 +585,7 @@ func newWriters(log lg.Log, cmd *cobra.Command, defaults config.Defaults, out, e
// via config or flag.
format := getFormat(cmd, defaults)
switch format { //nolint:exhaustive
switch format {
default:
// No format specified, use JSON
w.recordw = jsonw.NewStdRecordWriter(out2, fm)

View File

@ -67,7 +67,7 @@ func execVersion(cmd *cobra.Command, args []string) error {
func fetchBrewVersion(ctx context.Context) (string, error) {
const u = `https://raw.githubusercontent.com/neilotoole/homebrew-sq/master/sq.rb`
req, err := http.NewRequestWithContext(ctx, "GET", u, http.NoBody)
req, err := http.NewRequestWithContext(ctx, http.MethodGet, u, http.NoBody)
if err != nil {
return "", errz.Err(err)
}
@ -79,10 +79,8 @@ func fetchBrewVersion(ctx context.Context) (string, error) {
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
if err != nil {
return "", errz.Errorf("failed to check edgectl brew repo: %d %s",
resp.StatusCode, http.StatusText(resp.StatusCode))
}
return "", errz.Errorf("failed to check edgectl brew repo: %d %s",
resp.StatusCode, http.StatusText(resp.StatusCode))
}
body, err := io.ReadAll(resp.Body)