Skip to content
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

Merged
merged 4 commits into from
Mar 16, 2023
Merged

Refactoring minor #44

merged 4 commits into from
Mar 16, 2023

Conversation

dozer-jang
Copy link
Contributor

What this PR does / why we need it (변경 내용 / 필요성):

Minor Refactoring

  1. 사용하지 않는 util.Exec 제거
  2. 오타 수정
  3. time.Time 중복 conversion
  4. 에러 래핑 시 format verb %w사용

Which issue(s) this PR fixes (관련 이슈):

None

Special notes for your reviewer (리뷰어에게 하고 싶은 말):

#43 리팩토링 이전에 IDE에서 알려주는 간단한 리팩토링 진행했습니다.

Additional documentation, usage docs, etc. (기타 관련 문서, 사용법 등):

@dozer-jang dozer-jang changed the base branch from main to develop March 16, 2023 06:16
@dozer-jang dozer-jang requested a review from jmnote March 16, 2023 06:16
Copy link
Contributor

@jmnote jmnote left a 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)
Copy link
Contributor

Choose a reason for hiding this comment

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

어떤 차이가 있나요?

Copy link
Contributor Author

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 함수의 에러를 핸들링 할 수 없습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

util/exec.go Show resolved Hide resolved
@dozer-jang dozer-jang merged commit 9ce7706 into develop Mar 16, 2023
@dozer-jang dozer-jang deleted the refactoring-minor branch March 16, 2023 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants