What keyword is used to declare a variable in Go?
- const
- int
- let
- var
In Go, the keyword 'var' is used to declare a variable. It's followed by the variable name and its type. For example, var age int declares a variable named 'age' of type 'int'. 'var' is a fundamental keyword in Go for variable declaration.
Loading...
Related Quiz
- You notice that a Go application is consuming more memory than expected. How would you go about identifying and fixing the memory leak?
- The _______ keyword in Go is used to declare anonymous functions.
- How would you implement a timeout using channels?
- Which of the following is not a valid way to call a function in Go?
- In Go, goroutines are scheduled by the _______.