Monorepo for Tangled
test
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

appview/oauth: fix errcheck lint violations

Acknowledge the return values of Body.Close() on three HTTP response
bodies and SaveAuthRequestInfo in StartElevatedAuthFlow, satisfying
the errcheck linter. No behaviour change.

Signed-off-by: Matías Insaurralde <matias@insaurral.de>

+4 -4
+3 -3
appview/oauth/handler.go
··· 321 321 if err != nil { 322 322 return nil, fmt.Errorf("failed to create session: %v", err) 323 323 } 324 - defer sessionResp.Body.Close() 324 + defer func() { _ = sessionResp.Body.Close() }() 325 325 326 326 if sessionResp.StatusCode != http.StatusOK { 327 327 return nil, fmt.Errorf("failed to create session: HTTP %d", sessionResp.StatusCode) ··· 356 356 if err != nil { 357 357 return fmt.Errorf("failed to refresh session: %w", err) 358 358 } 359 - defer resp.Body.Close() 359 + defer func() { _ = resp.Body.Close() }() 360 360 361 361 if resp.StatusCode != http.StatusOK { 362 362 var errorResponse map[string]any ··· 430 430 if err != nil { 431 431 return fmt.Errorf("failed to add user to default service: %w", err) 432 432 } 433 - defer resp.Body.Close() 433 + defer func() { _ = resp.Body.Close() }() 434 434 435 435 if resp.StatusCode != http.StatusOK { 436 436 var errorResponse map[string]any
+1 -1
appview/oauth/oauth.go
··· 407 407 } 408 408 409 409 info.AccountDID = &parsedDid 410 - o.ClientApp.Store.SaveAuthRequestInfo(ctx, *info) 410 + _ = o.ClientApp.Store.SaveAuthRequestInfo(ctx, *info) 411 411 412 412 if err := o.SetAuthReturn(w, r, returnURL, false); err != nil { 413 413 return "", fmt.Errorf("failed to set auth return: %w", err)