Complete the code to print "Hello, Go!".
package main import "fmt" func main() { fmt.[1]("Hello, Go!") }
The Println function prints the text with a newline at the end.
Complete the code to declare a variable named 'count' of type int with value 10.
package main
func main() {
var count [1] = 10
}The variable count should be of type int to hold integer values.
Fix the error in the function signature to accept an integer parameter named 'n'.
package main
func printNumber([1]) {
// function body
}int n which is incorrect in Go.In Go, function parameters are declared as name type, so n int is correct.
Fill both blanks to create a map from string to int with one key-value pair.
package main
func main() {
m := map[[1]][2]{
"age": 30,
}
}The map keys are strings and values are integers, so string and int are correct.
Fill all three blanks to create a slice of integers and append 5 to it.
package main import "fmt" func main() { nums := [][1]{1, 2, 3} nums = append(nums, [2]) fmt.[3](nums) }
The slice holds integers, so int is correct. We append the number 5, and print with Println.
