1 Matching Annotations
  1. Dec 2022
    1. The deferred call's arguments are evaluated immediately, but the function call is not executed until the surrounding function returns.

      延迟调用的参数会立即求值,但直到周围函数返回时才会执行函数调用。

      ``` func main() { defer fmt.Println(time.Now()) time.Sleep(time.Second * 2) fmt.Println(time.Now()) }

      ```