[Core] Fix named imports across the entire codebase
Opened this issue · 5 comments
Objective
Follow best Golang practices w.r.t named imports
Origin Document
Goals
- Follow best practices in Go
- Stay consistent w.r.t imports throughout the codebase
Deliverable
- Identify and update all named imports in Go that are
CamelCase
and change them tosnake_case
Non-goals / Non-deliverables
- Any business logic changes
General issue deliverables
- Update the appropriate CHANGELOG(s)
- Update any relevant local/global README(s)
- Update relevant source code tree explanations
- Add or update any relevant or supporting mermaid diagrams
Testing Methodology
- Task specific tests or benchmarks:
make ...
- New tests or benchmarks:
make ...
- All tests:
make test_all
- LocalNet: verify a
LocalNet
is still functioning correctly by following the instructions at docs/development/README.md - k8s LocalNet: verify a
k8s LocalNet
is still functioning correctly by following the instructions here
Creator: @Olshansk
@kutoft We discussed you trying out a core starter task
issue to get "hands on" with the codebase. Wdyt of this one?
tl;dr Goal is to make all named imports snake_case
(2) is what we DON'T WANT and (1) is what we DO WANT
- If we do a regex search all
camelCase
imports (e.g.^\s*([a-z]+(?:[A-Z][a-z]*)*)\s
), we find the following:
- If we do a regex search all
snake_case
imports (e.g.^\s*([a-z]+_[a-z_]+)\s+"github\.com(.*?)"
), we find the following:
@Olshansk Your message seems a little contradictory. So I just want to confirm which casing structure you want here, camelCase or snake_case.
Additionally, I was reading up on GO language patterns, and it appears the common practice is to name packages as all lowercase. Would you rather stick with this convention?
Response to the question is below but please hold off on implementation until further notice
while our team reevaluated priorities.
Additionally, I was reading up on GO language patterns, and it appears the common practice is to name packages as all lowercase. Would you rather stick with this convention?
Yes. Attaching the GPT screenshot from our offline conversation for reference.
Tl;dr
- Replace
snake_case
withlowercase
- Replace
PascalCase
withlowercase
- Replace
camelCase
withlowercast