Naming things is hard.
All checks were successful
Build & Test / Main (push) Successful in 2m26s

This commit is contained in:
2024-03-29 01:15:59 -07:00
parent 2d991880ce
commit 9e6abb1112
4 changed files with 48 additions and 52 deletions

View File

@@ -17,17 +17,16 @@ type Model struct {
displayStats bool
}
func New(assets []coindesk.Asset, cfg config.All, displayStats bool) (m Model) {
func New(assets []coindesk.Asset, cfg config.Root, displayStats bool) (m Model) {
m.stats = perf.New()
m.displayStats = displayStats
// construct models for each asset, but don't filter out dupes
// construct models for each asset, but remove dupes
seen := map[coindesk.Asset]struct{}{}
for _, a := range assets {
_, ok := seen[a]
if ok {
if _, ok := seen[a]; ok {
continue
}
assetCfg := cfg.GetData(a)
assetCfg := cfg.ForAsset(a)
assetModel := asset.New(assetCfg)
m.assets = append(m.assets, assetModel)
seen[a] = struct{}{}