When importing a package in Go, if we want to execute its init functions, we use the _________ form of the import statement.

  • deferred
  • blank
  • named
  • inline
The correct option is "blank". In Go, if you want to execute the init functions of a package without directly using its exported symbols, you can use the blank identifier _ in the import statement. This signals to the compiler that you're importing the package solely for its side effects, such as initializing global variables or setting up the environment.
Add your answer
Loading...

Leave a comment

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