I am trying to split string based on split function in golang. But getting illegal rune literal error for r == '/--/' && r == '/-iN-/' && r == '/--/'
func Split(r rune) bool {
return r == '/--/' && r == '/-iN-/' && r == '/--/'
}
I am trying to split string based on split function in golang. But getting illegal rune literal error for r == '/--/' && r == '/-iN-/' && r == '/--/'
func Split(r rune) bool {
return r == '/--/' && r == '/-iN-/' && r == '/--/'
}
In Go, you can use single quotes for literal values that consist of a single character.
If you want to write a string literal, you should use double quotes or backticks :
You would also have to change your
Splitfunction because arunecannot be compared to a string.