Compiling without errors

Report a typo

Lena has just finished working on her first "Hello, World!" Go program. However, when she tries to compile it via the go build command, she stumbles upon some errors and can't properly compile her program.

Below you will see a list of different code snippets. Select the correct one that will make Lena's program compile without errors.

a)

package hello

import "fmt"

func hello() {
    fmt.Println("Hello, World!")
}

b)

package main

import "format"

func main() {
    fmt.Println("Hello, World!")
}

c)

package main

import "fmt"

func main() {
    fmt.Println("Hello, World!")
}

d)

pkg main

import "fmt"

func main() {
    print("Hello, World!")
}
Select one option from the list
___

Create a free account to access the full topic