Beginner Go (Golang)
Q3 / 100

How do you declare a variable with type inference in Go?

Correct! Well done.

Incorrect.

The correct answer is B) x := 5

B

Correct Answer

x := 5

Explanation

The short variable declaration x := 5 infers the type. var x int = 5 is the explicit form. := cannot be used at package level.

Progress
3/100