awesome-patterns/playground/codecoverage/size.go
Bruce b97231eecb
Practice code coverage
Signed-off-by: Bruce <weichou1229@gmail.com>
2019-02-20 14:52:34 +08:00

18 lines
238 B
Go

package codecoverage
func Size(a int) string {
switch {
case a < 0:
return "negative"
case a == 0:
return "zero"
case a < 10:
return "small"
case a < 100:
return "big"
case a < 1000:
return "huge"
}
return "enormous"
}