Go:Warnings
Go 코드에서 나는 고약한 냄새 지우는 방법. 주로 coc-go 에서 출력되거나 GoLand 에서 출력됨.
should use for range instead of for { select {} }
Select statements with a single case can be replaced with a simple send or receive.
Before:
After:
error strings should not be capitalized
regex 사용이 편하다, 에러 체인에 일관성이 생긴다 등 여러 의견이 있음.
for loop can be modernized using range over int
Before:
After:
See also
- go
- coc-go
- GoLand
- Staticcheck
- modernize