compareByte returns a Result where the result is Equal if x == y, similar if x and y differ only in casing, and different otherwise.
(x, y byte)
| 381 | // compareByte returns a Result where the result is Equal if x == y, |
| 382 | // similar if x and y differ only in casing, and different otherwise. |
| 383 | func compareByte(x, y byte) (r Result) { |
| 384 | switch { |
| 385 | case x == y: |
| 386 | return equalResult // Identity |
| 387 | case unicode.ToUpper(rune(x)) == unicode.ToUpper(rune(y)): |
| 388 | return similarResult // Modified |
| 389 | default: |
| 390 | return differentResult // UniqueX or UniqueY |
| 391 | } |
| 392 | } |
| 393 | |
| 394 | var ( |
| 395 | equalResult = Result{NumDiff: 0} |
no outgoing calls
no test coverage detected