Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic: runtime error: index out of range [0] with length 0 #17

Closed
vinay-singh-in opened this issue Mar 30, 2022 · 3 comments
Closed

panic: runtime error: index out of range [0] with length 0 #17

vinay-singh-in opened this issue Mar 30, 2022 · 3 comments

Comments

@vinay-singh-in
Copy link

I am getting the following when I am trying to invoke sshs on Arch Linux:

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

goroutine 1 [running]:
github.com/quantumsheep/sshs/ui.NewHostsTable(0xc00012c1c0, {0xc000018be8, 0x7b6232}, {0x0, 0x0}, 0x0)
	/home/runner/work/sshs/sshs/ui/hosts.go:121 +0x705
github.com/quantumsheep/sshs/cmd.run(0xa81fc0, {0x7a3156, 0x0, 0x0})
	/home/runner/work/sshs/sshs/cmd/root.go:64 +0x2f8
github.com/spf13/cobra.(*Command).execute(0xa81fc0, {0xc000012200, 0x0, 0x0})
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.3.0/command.go:860 +0x5f8
github.com/spf13/cobra.(*Command).ExecuteC(0xa81fc0)
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.3.0/command.go:974 +0x3bc
github.com/spf13/cobra.(*Command).Execute(...)
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.3.0/command.go:902
github.com/quantumsheep/sshs/cmd.Execute()
	/home/runner/work/sshs/sshs/cmd/root.go:100 +0x25
main.main()
	/home/runner/work/sshs/sshs/main.go:8 +0x17

I have tried installing AUR as well as binaries from the releases section. What am I missing?

@quantumsheep
Copy link
Owner

It seems to happen when you have an empty host config with spaces after the Host directive but without anything else.

@quantumsheep
Copy link
Owner

It's fixed in 3.1.0.

I'll try to update the package on the AUR, it requires Go 1.18 so I'm not sure if that's easy or not. In the meantime you can use the prebuilt binaries attached to the tag.

@vinay-singh-in
Copy link
Author

Yes, you are right I indent the lines after host for readability. The problem is fixed in 3.1.0, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants