Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7c3b3ef616 | |||
| 0a1a61d8d3 | |||
| 5912157ed1 | |||
| c5ff494e13 | |||
| bc99d40713 | |||
| 8010a00e4d | |||
| 259a630b78 | |||
| f64a3521c4 |
@@ -1,2 +1,4 @@
|
|||||||
/.env
|
/.env
|
||||||
/.worktrees/
|
/.worktrees/
|
||||||
|
.DS_Store
|
||||||
|
.idea/
|
||||||
Generated
-8
@@ -1,8 +0,0 @@
|
|||||||
# Default ignored files
|
|
||||||
/shelf/
|
|
||||||
/workspace.xml
|
|
||||||
# Editor-based HTTP Client requests
|
|
||||||
/httpRequests/
|
|
||||||
# Datasource local storage ignored files
|
|
||||||
/dataSources/
|
|
||||||
/dataSources.local.xml
|
|
||||||
Generated
-9
@@ -1,9 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="WEB_MODULE" version="4">
|
|
||||||
<component name="Go" enabled="true" />
|
|
||||||
<component name="NewModuleRootManager">
|
|
||||||
<content url="file://$MODULE_DIR$" />
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
||||||
Generated
-8
@@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/crypto-price-bot.iml" filepath="$PROJECT_DIR$/.idea/crypto-price-bot.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
Generated
-6
@@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="VcsDirectoryMappings">
|
|
||||||
<mapping directory="" vcs="Git" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
# Go filenames consistency design
|
||||||
|
|
||||||
|
## Context
|
||||||
|
|
||||||
|
The repository has inconsistent `.go` filename semantics in multiple areas (domain-oriented names, endpoint/history-oriented names, mixed singular/plural forms).
|
||||||
|
This slows code navigation because filenames do not consistently communicate data dimension or responsibility.
|
||||||
|
|
||||||
|
Goal: refactor `.go` filenames across the whole repository to a consistent naming model, and align declaration placement with filename responsibility, without changing runtime behavior.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
Applies to all `.go` files in the repository.
|
||||||
|
|
||||||
|
In scope:
|
||||||
|
- Rename `.go` files to consistent, responsibility-first names.
|
||||||
|
- Mechanical updates required by rename/move.
|
||||||
|
- Move declarations between files when needed so file responsibility is clear.
|
||||||
|
|
||||||
|
Out of scope:
|
||||||
|
- Any behavior or logic changes.
|
||||||
|
- Non-`.go` files.
|
||||||
|
- New feature work.
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
1. `.go` filename naming is consistent across the repository.
|
||||||
|
2. Filenames follow responsibility-first conventions:
|
||||||
|
- data-dimension names where applicable (`spot_*`, `futures_*`, etc.)
|
||||||
|
- pluralized collection-oriented files (`*_pairs.go`, `*_prices.go`)
|
||||||
|
- avoid endpoint/history-oriented naming that obscures responsibility.
|
||||||
|
3. Declarations in each file match filename responsibility.
|
||||||
|
4. No public/package behavior change.
|
||||||
|
5. Resulting PR remains reviewable by grouping changes mechanically and keeping logic untouched.
|
||||||
|
|
||||||
|
## Design
|
||||||
|
|
||||||
|
### Naming model
|
||||||
|
|
||||||
|
Use a responsibility-first naming model for all `.go` files:
|
||||||
|
- A reader should infer the primary responsibility from filename alone.
|
||||||
|
- Prefer domain/data-dimension names over transport/implementation-history names.
|
||||||
|
- Use consistent singular/plural convention based on file content (entity vs collection).
|
||||||
|
|
||||||
|
### Refactor mechanics
|
||||||
|
|
||||||
|
1. Inventory `.go` files by package and classify naming inconsistencies.
|
||||||
|
2. Define target filename map package-by-package.
|
||||||
|
3. Rename files with git-aware rename operations.
|
||||||
|
4. Move declarations when file content does not match filename responsibility.
|
||||||
|
5. Keep signatures and bodies unchanged.
|
||||||
|
6. Apply only mechanical reference/import updates required by moves.
|
||||||
|
|
||||||
|
### Execution strategy for reviewability
|
||||||
|
|
||||||
|
- Use focused commits by package or subsystem.
|
||||||
|
- Keep each commit behavior-neutral.
|
||||||
|
- Separate any necessary declaration moves from broad rename waves when this improves diff readability.
|
||||||
|
|
||||||
|
## Error handling and behavior
|
||||||
|
|
||||||
|
No new error handling paths are introduced.
|
||||||
|
Existing control flow and error behavior remain unchanged.
|
||||||
|
|
||||||
|
## Testing and verification
|
||||||
|
|
||||||
|
1. Run project tests after each major package/subsystem batch.
|
||||||
|
2. Run full project test command before PR.
|
||||||
|
3. Confirm no functional diff beyond rename/move/mechanical updates.
|
||||||
|
4. Final check: each renamed file contains declarations aligned with its responsibility.
|
||||||
|
|
||||||
|
## Risks and mitigations
|
||||||
|
|
||||||
|
- Risk: accidental behavior change while moving declarations.
|
||||||
|
- Mitigation: keep signatures/bodies unchanged and validate with tests per batch.
|
||||||
|
- Risk: review noise from repo-wide scope.
|
||||||
|
- Mitigation: package-grouped commits, strict mechanical-only edits, and explicit PR summary.
|
||||||
|
- Risk: large PR becomes hard to review.
|
||||||
|
- Mitigation: preserve commit structure and provide a clear rename map in PR description.
|
||||||
|
|
||||||
|
## Success criteria
|
||||||
|
|
||||||
|
- `.go` filenames are consistent and responsibility-first across the repo.
|
||||||
|
- Declarations in each file align with filename responsibility.
|
||||||
|
- Tests pass with no behavior regression.
|
||||||
|
- PR is understandable through structured, behavior-neutral commits.
|
||||||
@@ -5,7 +5,7 @@ go 1.25.0
|
|||||||
require (
|
require (
|
||||||
github.com/adshao/go-binance/v2 v2.8.11
|
github.com/adshao/go-binance/v2 v2.8.11
|
||||||
github.com/go-resty/resty/v2 v2.17.2
|
github.com/go-resty/resty/v2 v2.17.2
|
||||||
github.com/jedib0t/go-pretty/v6 v6.7.10
|
github.com/jedib0t/go-pretty/v6 v6.8.0
|
||||||
github.com/joho/godotenv v1.5.1
|
github.com/joho/godotenv v1.5.1
|
||||||
github.com/rs/zerolog v1.32.0
|
github.com/rs/zerolog v1.32.0
|
||||||
github.com/samber/lo v1.53.0
|
github.com/samber/lo v1.53.0
|
||||||
|
|||||||
@@ -257,8 +257,8 @@ github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpT
|
|||||||
github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4=
|
github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4=
|
||||||
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||||
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||||
github.com/jedib0t/go-pretty/v6 v6.7.10 h1:B/2qW2Bkv2L6n14PP8o1kx75kWzHOQ3YTluWzg9icac=
|
github.com/jedib0t/go-pretty/v6 v6.8.0 h1:fQOTjATVQl5RhssBro6ZuHANFybCkmJ7FjYPo4b7sEY=
|
||||||
github.com/jedib0t/go-pretty/v6 v6.7.10/go.mod h1:YwC5CE4fJ1HFUDeivSV1r//AmANFHyqczZk+U6BDALU=
|
github.com/jedib0t/go-pretty/v6 v6.8.0/go.mod h1:YwC5CE4fJ1HFUDeivSV1r//AmANFHyqczZk+U6BDALU=
|
||||||
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
|
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
|
||||||
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
|
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
|
||||||
github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA=
|
github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA=
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ const (
|
|||||||
|
|
||||||
var Token2StickerIdxMap = map[string]int{
|
var Token2StickerIdxMap = map[string]int{
|
||||||
"BNB": 3,
|
"BNB": 3,
|
||||||
"TON": 7,
|
"TON": 5,
|
||||||
}
|
}
|
||||||
|
|
||||||
var Sticker2TokenMap = map[string]string{
|
var Sticker2TokenMap = map[string]string{
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
go run cmd/tele/main.go ─╯
|
|
||||||
Reference in New Issue
Block a user