没有三目运算符的golang,有时候怎么处理才优雅简洁。最简单的方法就是if…else…判断

1
2
3
testValue := 1
testBool := test-1 == 0
fmt.Println(testBool)