module ExceptionHandling function divide(a, b) = {{ try {{ return a / b }} catch (e) {{ println("An error occurred: " + e) return 0 }} }} let a = 10 let b = 0 let result = divide(a, b) println("Result: " + result) } $ golo compile ExceptionHandling.golo $ golo run ExceptionHandling


上一篇:
下一篇:
切换中文