Multiple Choice
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 55/100
Research direction
The panic occurs at actions.go line 121 in the MultiChoice method. Examine the method to understand how it handles the slice of choices and the index. The test code shows a simple usage with four options; check for off-by-one errors or incorrect bounds checking. Run the provided test to reproduce the panic, then look at the surrounding code to see what assumptions are being violated.
Written by the indexing model from the issue text.
Description
When attempting to use the mutiple choice option, I get the following panic. Please let me know what other information would help assist in getting this fixed moving forward, I will also look into the code to see if there is anything I can do to fix it and submit a PR if I figure something out.
func Test(c *ishell.Context) {
choice := c.MultiChoice([]string{
"Golangers",
"Go programmers",
"Gophers",
"Goers",
}, "What are Go programmers called ?")
if choice == 2 {
c.Println("You got it!")
} else {
c.Println("Sorry, you're wrong.")
}
}
panic: runtime error: index out of range
goroutine 1 [running]:
gopkg.in/abiosoft/ishell%2ev2.(*shellActionsImpl).MultiChoice(0xc042004528, 0xc04213e2c0, 0x4, 0x4, 0x6f6916, 0x20, 0x0)
C:/Users/Ryan Gurnick/Documents/Go/src/gopkg.in/abiosoft/ishell.v2/actions.go:121 +0xb9
saiberAdmin/core/api.Test(0xc042166000)
C:/Users/Ryan Gurnick/Documents/Go/src/saiberAdmin/core/api/delete.go:22 +0xb8
saiberAdmin/core/io.Shell.func5(0xc042166000)
C:/Users/Ryan Gurnick/Documents/Go/src/saiberAdmin/core/io/io.go:63 +0x32
gopkg.in/abiosoft/ishell%2ev2.(*Shell).handleCommand(0xc042132000, 0xc0421440d0, 0x1, 0x1, 0xc04207dda0, 0xc04207dda8, 0x20)
C:/Users/Ryan Gurnick/Documents/Go/src/gopkg.in/abiosoft/ishell.v2/ishell.go:248 +0x2d3
gopkg.in/abiosoft/ishell%2ev2.handleInput(0xc042132000, 0xc0421440d0, 0x1, 0x1, 0xc04204bac0, 0xc042056540)
C:/Users/Ryan Gurnick/Documents/Go/src/gopkg.in/abiosoft/ishell.v2/ishell.go:202 +0x54
gopkg.in/abiosoft/ishell%2ev2.(*Shell).run(0xc042132000)
C:/Users/Ryan Gurnick/Documents/Go/src/gopkg.in/abiosoft/ishell.v2/ishell.go:181 +0x22f
gopkg.in/abiosoft/ishell%2ev2.(*Shell).Run(0xc042132000)
C:/Users/Ryan Gurnick/Documents/Go/src/gopkg.in/abiosoft/ishell.v2/ishell.go:97 +0x40
saiberAdmin/core/io.Shell()
C:/Users/Ryan Gurnick/Documents/Go/src/saiberAdmin/core/io/io.go:68 +0x455
main.main()
C:/Users/Ryan Gurnick/Documents/Go/src/saiberAdmin/main.go:11 +0x2c
exit status 2
- Dominant language
- Go
- Stars
- 1.8k
- Forks
- 213
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from abiosoft/ishell
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Similar issues
-
`renderLinkedIssues` overshoots its byte budget: unresolved and omitted lists are never boundedOpenagent-butler-finding agent-research-recommend bug ready-for-agent
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
jordansmall/spindrift#4614 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
weaviate/weaviate-go-client#485 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
litmuschaos/litmus#5641 ·
Maintainers usually reply within 6 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day