achannarasappa / ticker

Terminal stock ticker with live updates and position tracking
GNU General Public License v3.0
5.02k stars 273 forks source link

Panic error because of interface conversion: interface {} is nil, not []string #118

Closed stefaneacsu147 closed 3 years ago

stefaneacsu147 commented 3 years ago

Describe the bug It seems that something broke in the latest version and when you try to use any ticker command you get the following output:

panic: interface conversion: interface {} is nil, not []string

goroutine 1 [running]:
github.com/achannarasappa/ticker/internal/currency.transformResponseCurrencyPairs(0x0, 0x0, 0x0, 0x98ceae, 0x3, 0xc0002620a0, 0x0, 0x0)
    /home/runner/work/ticker/ticker/internal/currency/currency.go:78 +0x2df
github.com/achannarasappa/ticker/internal/currency.getCurrencyPairSymbols(0x0, 0x0, 0xc0001920f0, 0xc000192120, 0xc000192150, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    /home/runner/work/ticker/ticker/internal/currency/currency.go:89 +0x385
github.com/achannarasappa/ticker/internal/currency.GetCurrencyRates(0x0, 0x0, 0xc0001920f0, 0xc000192120, 0xc000192150, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    /home/runner/work/ticker/ticker/internal/currency/currency.go:98 +0xbf
github.com/achannarasappa/ticker/internal/cli.getReference(0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    /home/runner/work/ticker/ticker/internal/cli/cli.go:114 +0xf2
github.com/achannarasappa/ticker/internal/cli.GetContext(0xa45680, 0xd32c68, 0xc000001200, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    /home/runner/work/ticker/ticker/internal/cli/cli.go:72 +0x2a5
github.com/achannarasappa/ticker/cmd.initConfig()
    /home/runner/work/ticker/ticker/cmd/root.go:57 +0x10a
github.com/spf13/cobra.(*Command).preRun(0xcf7aa0)
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:880 +0x49
github.com/spf13/cobra.(*Command).execute(0xcf7aa0, 0xc00001e1d0, 0x0, 0x0, 0xcf7aa0, 0xc00001e1d0)
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:816 +0x14f
github.com/spf13/cobra.(*Command).ExecuteC(0xcf7aa0, 0x44570a, 0xcaf140, 0xc000054778)
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:958 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:895
github.com/achannarasappa/ticker/cmd.Execute()
    /home/runner/work/ticker/ticker/cmd/root.go:32 +0x31
main.main()
    /home/runner/work/ticker/ticker/main.go:6 +0x25

To Reproduce Just try to run ticker and it returns the following

Expected behavior After running ticker -w AAPL, TSLA to return the output

Screenshots

Environment (please complete the following information):

Additional context I have tried reinstalling via terminal, snap. cURL and the issue persist, also removed the cache and cleaned.

stefaneacsu147 commented 3 years ago

I just saw that it was fixed in 8a8fd37796b3aae262e69348b80226a7594f647a.