knuth-morris-pratt.go error handling