Correct way to declare global variables

Report a typo

Below you will see a Go program with a few global variables incorrectly declared. Your task is to fix the code and use the correct syntax to declare the global variables.

Take notice that for this task, it is not necessary for you to create the main function or write any code within it.
Write a program in Go
package main

import "fmt"

// Fix the global variable declarations below!

num := 42

ptr = new(int)

f := func() string { // anonymous function declaration
_ = fmt.Print // DO NOT delete this `fmt.Print` line!
return "Hello, JetBrains Academy!"
}
___

Create a free account to access the full topic