Start learning free

LESSON 46 OF 671 · FUNCTIONS I

Return: Buggy Code III in Go

Practice

We've written a program and expected it to print Hello, Andy, but the function tries to return a string instead of printing it.

hello is declared without a result type, so it cannot return a value, and the program does not compile. The code that calls hello("Andy") would not print a returned value anyway.

Assignment:

Fix hello so it prints "Hello, " + name.


STEP 1 OF 1
    Ctrl + Enter to check