GoToolSharing / htb-cli

Interact with Hackthebox using your terminal - Be faster and more competitive !
https://github.com/GoToolSharing/htb-cli
GNU General Public License v3.0
87 stars 6 forks source link

Information about a machine to be released - panic: runtime error: index out of range [0] with length 0 #31

Closed QU35T-code closed 1 year ago

QU35T-code commented 1 year ago

Error when displaying information about a machine about to be released :

❯ htb-cli info -m clicker
? Do you want to check for active machine ? No
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/GoToolSharing/htb-cli/utils.SearchItemIDByName({0x14000018b40?, 0x1?}, {0x0, 0x0}, {0x102ee5115, 0x7})
    /Users/qu35t/go/pkg/mod/github.com/!go!tool!sharing/htb-cli@v1.1.0/utils/utils.go:67 +0xcc0
github.com/GoToolSharing/htb-cli/cmd.glob..func2(0x1032ad8a0?, {0x102ee268c?, 0x2?, 0x2?})
    /Users/qu35t/go/pkg/mod/github.com/!go!tool!sharing/htb-cli@v1.1.0/cmd/info.go:91 +0x498
github.com/spf13/cobra.(*Command).execute(0x1032ad8a0, {0x1400006e6c0, 0x2, 0x2})
    /Users/qu35t/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:876 +0x4b8
github.com/spf13/cobra.(*Command).ExecuteC(0x1032adda0)
    /Users/qu35t/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:990 +0x354
github.com/spf13/cobra.(*Command).Execute(...)
    /Users/qu35t/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:918
github.com/GoToolSharing/htb-cli/cmd.Execute()
    /Users/qu35t/go/pkg/mod/github.com/!go!tool!sharing/htb-cli@v1.1.0/cmd/root.go:28 +0x28
main.main()
    /Users/qu35t/go/pkg/mod/github.com/!go!tool!sharing/htb-cli@v1.1.0/main.go:6 +0x1c
QU35T-code commented 1 year ago
❯ go run . info -m analytical
? Do you want to check for active machine ? No
No machine was found