The code compiles without killing the compiler and exits with status-code 0.
What did you see instead?
With a release version of go 1.19:
% go build .
./main.go:25:9: internal compiler error: method less on string not found
Please file a bug report including a short program that triggers the error.