diff options
| author | Paul Buetow <paul@buetow.org> | 2024-11-19 22:46:05 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2024-11-19 22:46:05 +0200 |
| commit | 836d21a7c43f4ce84dfa1ada0552989be4a43ca9 (patch) | |
| tree | fe6dc637c2c916e10b1beff31d687edf0f994503 /internal/schedule | |
| parent | 1550fbf9c2b0602c4675f25cd92e389593894e58 (diff) | |
use of platform aliases
Diffstat (limited to 'internal/schedule')
| -rw-r--r-- | internal/schedule/schedule.go | 5 | ||||
| -rw-r--r-- | internal/schedule/stats.go | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/internal/schedule/schedule.go b/internal/schedule/schedule.go index 4f25fb4..9b31f88 100644 --- a/internal/schedule/schedule.go +++ b/internal/schedule/schedule.go @@ -12,6 +12,7 @@ import ( "codeberg.org/snonux/gos/internal/config" "codeberg.org/snonux/gos/internal/entry" "codeberg.org/snonux/gos/internal/oi" + "codeberg.org/snonux/gos/internal/platforms" "codeberg.org/snonux/gos/internal/prompt" ) @@ -20,8 +21,8 @@ var ( ErrNothingQueued = errors.New("nothing queued") ) -func Run(args config.Args, platform string) (entry.Entry, error) { - dir := fmt.Sprintf("%s/db/platforms/%s", args.GosDir, strings.ToLower(platform)) +func Run(args config.Args, platform platforms.Platform) (entry.Entry, error) { + dir := fmt.Sprintf("%s/db/platforms/%s", args.GosDir, platform.String()) stats, err := newStats(dir, args.Lookback, args.Target) if err != nil { return entry.Zero, err diff --git a/internal/schedule/stats.go b/internal/schedule/stats.go index 1cbc4ec..42f9332 100644 --- a/internal/schedule/stats.go +++ b/internal/schedule/stats.go @@ -11,6 +11,7 @@ import ( "codeberg.org/snonux/gos/internal/colour" "codeberg.org/snonux/gos/internal/entry" "codeberg.org/snonux/gos/internal/oi" + "codeberg.org/snonux/gos/internal/platforms" "codeberg.org/snonux/gos/internal/timestamp" ) @@ -44,7 +45,7 @@ func (s stats) String() string { ) } -func (s stats) Render(platform string) { +func (s stats) Render(platform platforms.Platform) { var sb strings.Builder sep := colour.SInfo2f("+%s+%s+", strings.Repeat("-", 22), strings.Repeat("-", 13)) |
