Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@takutakahashi
Copy link

@takutakahashi takutakahashi commented Feb 14, 2024

レスポンスが正常に成功したが orgRes が存在しない場合があるため、エラーを追加しました

@takutakahashi takutakahashi changed the title error handling: err == nil && orgRes == nil err == nil && orgRes == nil の場合があったためエラーを追加 Feb 14, 2024
}
if orgRes.StatusCode != 200 && orgRes.StatusCode != 304 {
log.Println(orgRes.Status)
return nil, err
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここで err は必ず nil になるので、nil, nil が返却されます。これは go のプラクティスに則っていないので、変更箇所で新規に err を返却しています。

Copy link
Member

@windyakin windyakin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@takutakahashi takutakahashi merged commit 6a7aebb into master Feb 14, 2024
@takutakahashi takutakahashi deleted the add_error_handling branch February 14, 2024 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants