Creating and calling a function

Report a typo

Create a function (you can choose its name yourself) that takes an input of the user's name as a string argument and returns the following message: "userName is learning how to call functions!"

After creating the function, call it within the main function of your program.

Sample Input 1:

Bob

Sample Output 1:

Bob is learning how to call functions!
Write a program in Go
package main

import "fmt"

func // function name, parameters and return type here {
// write the function code block here
}

func main() {
// Do not change this two lines of code
var userName string
fmt.Scanf("%s", &userName)

// call the function directly, or within a fmt.Println statement here.
}
___

Create a free account to access the full topic