whalebrew/whalebrew

Immediate failure for `whalebrew search` on macOS Mojave with whalebrew 0.2.5

yonkeltron opened this issue · 3 comments

Hey! Thanks for writing whalebrew! I'm writing this issue to report a problem I've run into on my macOS device running Mojave.

When running any sort of whalebrew search command, including without any additional arguments, I get an immediate panic:

> whalebrew search
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/whalebrew/whalebrew/cmd.glob..func4(0x1a67600, 0x1aa15a8, 0x0, 0x0, 0x0, 0x0)
	/private/tmp/whalebrew-20201104-29862-1o7c2tw/cmd/search.go:30 +0x216
github.com/spf13/cobra.(*Command).execute(0x1a67600, 0x1aa15a8, 0x0, 0x0, 0x1a67600, 0x1aa15a8)
	/Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/cobra@v0.0.4-0.20190321000552-67fc4837d267/command.go:762 +0x47c
github.com/spf13/cobra.(*Command).ExecuteC(0x1a673a0, 0x168aaa5, 0x1, 0x1008300)
	/Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/cobra@v0.0.4-0.20190321000552-67fc4837d267/command.go:850 +0x30b
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/cobra@v0.0.4-0.20190321000552-67fc4837d267/command.go:800
main.main()
	/private/tmp/whalebrew-20201104-29862-1o7c2tw/main.go:15 +0x46

About my environment:

> whalebrew version
Whalebrew 0.2.5
> docker --version
Docker version 19.03.13, build 4484c46d9d
> uname -a
Darwin HOSTNAME.local 18.7.0 Darwin Kernel Version 18.7.0: Mon Aug 31 20:53:32 PDT 2020; root:xnu-4903.278.44~1/RELEASE_X86_64 x86_64

Please let me know if I can provide any additional information, or test out any fixes.

Hi!
Thanks for raising! This issue has actually been solved by #120 but not released yet. The problem occurs when calling search with no argument.
I shall be releasing some time soon.

I have just released 0.3.0 which should solve the issue. Cam you confirm this solves the problem for you?

Yes! It works properly now, both with and without arguments. Thank you so much for taking the issue seriously and for letting me help out in some small way. I appreciate everything the Whalebrew team does.

Thanks,
+Jonathan