refactor: 코드 가독성 개선 및 버그 수정
Some checks failed
CI/CD / test (push) Has been cancelled
CI/CD / release (push) Has been cancelled

- main.go를 main()만 남기고 함수 분리 (game.go, protocol.go, ui.go)
- 재시도 로직을 retryWithBackoff 공통 함수로 통합
- redeemTicketFrom 별도 HTTP 클라이언트 → apiClient 사용으로 통일
- doDownload에서 resumeOffset 이중 계산 제거
- extractZip에서 stripTopDir/extractFile 함수 분리
- downloadWithProgress에서 createProgressWindow 함수 분리
- DLL 선언을 DLL별로 그룹화, 상수를 역할별로 분리
- 전체 주석 한국어 통일 및 섹션 구분 추가

버그 수정:
- ensureLauncher가 설치 경로 대신 실행 중인 경로를 해시하던 문제 수정
- uninstall 시 실행 중인 exe 삭제 실패 → 백그라운드 cmd로 대체
- moveContents에서 os.Remove 에러를 무시하던 문제 수정
- install/uninstall 메시지 통일, exitWithError 헬퍼 추가
- .gitignore에 *.exe 통일, ANALYSIS.md 삭제
- 빌드 명령에 git 태그 기반 버전 주입 추가

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-29 02:17:51 +09:00
parent 742712aa49
commit 281a365952
9 changed files with 617 additions and 686 deletions

View File

@@ -3,10 +3,11 @@
## Build Command
```bash
C:\Users\98kim\sdk\go1.25.1\bin\go.exe build -ldflags="-H windowsgui -s -w" -o launcher.exe .
C:\Users\98kim\sdk\go1.25.1\bin\go.exe build -ldflags="-H windowsgui -s -w -X main.version=$(git describe --tags --always)" -o launcher.exe .
```
`-H windowsgui` 필수 — 없으면 실행 시 콘솔 창이 함께 열림.
- `-H windowsgui` 필수 — 없으면 실행 시 콘솔 창이 함께 열림.
- `-X main.version=...` — git 태그 기반 버전 자동 주입. 태그가 있으면 `v1.0.0`, 태그 이후 커밋이 있으면 `v1.0.0-3-gabcdef` 형태.
## Tech Stack