Eye-Remocon Tech Blog Home Edge Project

Modify storagehandler.gofile

Handler logger 수정

1️⃣ Replace handler.logger in storagehandler.go file with logmgr

K-010

  • Description : Since DataStorage uses two types of logger, storagehandler.go file is modified. so, the handler.logger part of the storagehandler.go file was replaced wtih logmgr.
  • Type of change : Code cleanup/refactoring
  • PR
  • Related Issue : #173


2️⃣ 컨트리뷰션을 위한 노력

  • 이슈 1: 테스트 시 build failed 오류
  • image

  • 해결책
    • 원인 : 중복으로 선언되어 에러 발생, 다른 package storagedriver에서 이미 선언됨
    • 해결 방법 : logmgr import 부분을 제거하면 log redeclared as imported package name 에러 해결 가능

3️⃣ 값진 코드 리뷰

  • 프로젝트 내 테스트 위해서 이미 테스트하는 모듈 존재
  • 테스트 파일을 활용해 테스트 후, 결과를 PR에 반영
    • edge-home-orchestration-go 폴더
      • $ go test -v ./internal/controller/storagemgr/storagedriver/
    • edge-home-orchestration-go/internal/controller/storagemgr/storagedriver 폴더
      • $ go test -v .