go-alfred icon indicating copy to clipboard operation
go-alfred copied to clipboard

Panic after change workflow website

Open danie1Lin opened this issue 4 years ago • 0 comments

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

goroutine 1 [running]:
github.com/jason0x43/go-alfred.(*Workflow).updateAvailable(0x16bbbc0, 0x1041300, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/Users/daniellin/go/src/github.com/jason0x43/go-alfred/workflow.go:654 +0x7b2
github.com/jason0x43/go-alfred.(*Workflow).UpdateAvailable(...)
	/Users/daniellin/go/src/github.com/jason0x43/go-alfred/workflow.go:442
github.com/jason0x43/go-alfred.(*Workflow).AddUpdateItem(0x16bbbc0, 0xc0001158b0)
	/Users/daniellin/go/src/github.com/jason0x43/go-alfred/workflow.go:365 +0x48
github.com/jason0x43/go-alfred.(*Workflow).Run(0x16bbbc0, 0xc000115e80, 0x7, 0x7)
	/Users/daniellin/go/src/github.com/jason0x43/go-alfred/workflow.go:280 +0xa88
main.main()
	/Users/daniellin/alfred-redmine/main.go:55 +0x653

https://github.com/jason0x43/go-alfred/blob/9ea6c1f3044f0085c7cd22d4dac46da415e67ff9/workflow.go#L648 the Search function will return the insert position when word is not match in sorted string list . So it will not return -1

danie1Lin avatar Nov 28 '20 03:11 danie1Lin