Start learning free

LESSON 28 OF 671 · FUNCTIONS I

Defining Functions: Buggy Code in Go

Practice

Inside the code editor we've tried to define a function named sayMyName that prints Hey, Andy!.

A Go function body must be wrapped in curly braces:

func sayMyName() {
    fmt.Println("Hey, Andy!")
}

Assignment:

Your task is to fix the function so the code is valid Go and the message is printed when the test calls it.


STEP 1 OF 1
    Ctrl + Enter to check