The _______ keyword in Go is used to create a closure.

  • defer
  • func
  • package
  • return
The "func" keyword in Go is used to declare functions. Closures in Go are anonymous functions that can access variables declared in their surrounding scope. By using the "func" keyword, developers can create closures, which are useful for handling tasks like callbacks.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *