Hacker News new | ask | show | jobs
by howeyc 1943 days ago
cd tsukae

go build

./tsukae

1 comments

Closer! That got me the executable. Now I get a stack trace....

  % ./tsukae bash
  panic: runtime error: slice bounds out of range [:7] with capacity 4

  goroutine 1 [running]:
    github.com/irevenko/tsukae/cmd.GetShellCommandsUsage(0x1205b84, 0x4, 0x7, 0x4, 0x3, 0xc000066180, 0xc000127d78, 0x1159965, 0xc000120500)
   /Users/pww/tsukae/cmd/shell_name.go:22 +0x16d
  github.com/irevenko/tsukae/cmd.glob..func4(0x135df20, 0xc00005c8b0, 0x0, 0x1)
   /Users/pww/tsukae/cmd/commands.go:88 +0x1bf
  github.com/spf13/cobra.(*Command).execute(0x135df20, 0xc00005c8a0, 0x1, 0x1, 0x135df20, 0xc00005c8a0)
    /Users/pww/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:856 +0x2c2
  github.com/spf13/cobra.(*Command).ExecuteC(0x135e1a0, 0xc000000180, 0xc000127f78, 0x10069e5)
     /Users/pww/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:960 +0x375
  github.com/spf13/cobra.(\*Command).Execute(...)
       /Users/pww/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:897
  main.main()
   /Users/pww/tsukae/main.go:12 +0x36
i figured it out, you just need to have bigger history, currently you only have 4 unique commands in your hist file.
My history has a few thousand commands....