Complete the code to declare a variable with type inference.
var x = [1]In Go, you can declare a variable with type inference by assigning a value directly. Here, var x = "Hello, Go!" lets Go infer that x is a string.
Complete the code to declare and initialize a variable using short variable declaration with type inference.
count [1] 10
The short variable declaration count := 10 declares count and lets Go infer its type as int.
Fix the error in the code by completing the variable declaration with type inference.
var pi [1] 3.14
When using var with explicit variable name, you must use = to assign a value. Type inference happens automatically.
Fill both blanks to declare a variable with type inference and assign a boolean value.
isReady [1] [2]
Using isReady := true declares isReady with type inferred as bool and assigns it the value true.
Fill both blanks to create a map with type inference and initialize it with values.
scores := map[string]int{"Alice": {BLANK_2}}, "Bob": {{BLANK_2}}The code scores := map[string]int{"Alice": 90, "Bob": 85} declares a map with string keys and int values, using type inference for scores.