• Declare variadic function
  • Variadic function parameter type is .... Different from slice.
  • Action can be defered with a defer statement. Defered function will be called after function contains the defer statement has been done (after return value).
  • Any number of defer can be declared, it will be executed by reversed defer order.

  • Need extra parentheses when defer a function. Ex. defer f()()
  • A defered function can observe the function’s result.
  • A defered function can even change the result. Ex.

Tags:

Updated: