Complete the code to declare a package named main.
package [1]The package name main is used for executable programs in Go.
Complete the code to import the fmt package.
import [1]"fmt"
In Go, multiple imports are enclosed in parentheses ( ). Even for one import, parentheses are used for grouping.
Fix the error in the variable declaration to make it package scoped.
var [1] = 42
In Go, identifiers starting with a capital letter are exported and have package scope accessible outside the package.
Fill both blanks to define a package-level function and call it inside main.
func [1]() { println("Hello from package scope") } func main() { [2]() }
Functions starting with a capital letter are exported and package scoped. The same name is used to define and call the function.
Fill all three blanks to create a package-level constant, a variable, and a function that uses them.
const [1] = "GoLang" var [2] = 2024 func [3]() string { return [1] + " " + string([2]) }
Constants and variables starting with capital letters are exported. The function name starting with a capital letter is also exported and can access these package-level identifiers.