ericm / stonks

Stonks is a terminal based stock visualizer and tracker that displays realtime stocks in graph format in a terminal. See how fast your stonks will crash.
https://stonks.icu
GNU General Public License v3.0
548 stars 35 forks source link

Type error when running stonks #6

Closed ghost closed 4 years ago

ghost commented 4 years ago

$ stonks AMD panic: interface conversion: interface {} is int, not graph.ChartTheme

goroutine 1 [running]: main.main.func1(0xc0000eeb00, 0xc0000ad530, 0x1, 0x1) /home/jc/Documents/finance/stonks/main.go:106 +0x1606 github.com/spf13/cobra.(Command).execute(0xc0000eeb00, 0xc0000ba030, 0x1, 0x1, 0xc0000eeb00, 0xc0000ba030) /home/jc/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:846 +0x29d github.com/spf13/cobra.(Command).ExecuteC(0xc0000eeb00, 0xc0000c4bc8, 0x910edb, 0x7) /home/jc/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:950 +0x349 github.com/spf13/cobra.(*Command).Execute(...) /home/jc/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:887 main.main() /home/jc/Documents/finance/stonks/main.go:192 +0x605

OS: linux mint 19.2 Stonks was installed using go version go1.14.3 linux/amd64

Steps to reproduce: $ stonks -s AMD $ stonks

ericm commented 4 years ago

Thanks. I'll fix that asap.

FileGo commented 4 years ago

This should do for main.go:106.

chartTheme := graph.ChartTheme(viper.GetInt("config.default_theme"))