-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring minor #44
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
테스트 통과했고, 코드도 이상 없는 것으로 보입니다.
수고하셨습니다.
@@ -15,21 +15,21 @@ func getDiskAvailableBytes(path string) (string, error) { | |||
// get absolute path | |||
absPath, err := filepath.Abs(path) | |||
if err != nil { | |||
return "", fmt.Errorf("cannot get absoluth path for [%s]: %s", path, err) | |||
return "", fmt.Errorf("cannot get absoluth path for [%s]: %w", path, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
어떤 차이가 있나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
absPath, err := filepath.Abs(path)
에서 발생한 err
의 정보를 getDiskAvailableBytes
함수를 호출한 곳에서 알 수 없습니다. 물론 string
으로 어떤 에러인지 확인할 수 있지만 Unwrap
으로 해당 에러 타입을 검사할 수 없습니다.
따라서 만약 getDiskAvailableBytes
함수 호출 부분에서 filepath.Abs 함수의 에러를 핸들링 할 수 없습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What this PR does / why we need it (변경 내용 / 필요성):
Minor Refactoring
util.Exec
제거time.Time
중복 conversion%w
사용Which issue(s) this PR fixes (관련 이슈):
None
Special notes for your reviewer (리뷰어에게 하고 싶은 말):
#43 리팩토링 이전에 IDE에서 알려주는 간단한 리팩토링 진행했습니다.
Additional documentation, usage docs, etc. (기타 관련 문서, 사용법 등):