8.4.6 总结
func ReallyBigFunc() {
// Part 1: Fast Operations with few statements
// stmt0
// stmt1
result := expr()
if result {
return
}
// Part 2: Slow operations with many statements
// stmt4
// stmt5
// ...
// stmt100
}func slowOp() {
// Part 2: Slow operations with many statements
// stmt4
// stmt5
// ...
// stmt100
}
func ReallyBigFunc() {
// Part 1: Fast Operations with few statements
// stmt0
// stmt1
result := expr()
if !result {
slowOp()
}
}
func main() {
ReallyBigFunc()
}最后更新于