You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func main() {
// Get a greeting message and print it.
message := greetings.Hello("Gladys")
fmt.Println(greeting) /* This should be message */ => it yields compilation error "./hello.go:12:17: undefined: greeting"
}
Please change it to
func main() {
// Get a greeting message and print it.
message := greetings.Hello("Gladys")
fmt.Println(message)
}
The text was updated successfully, but these errors were encountered:
What version of Go are you using (
go version
)? 1.15Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)? MAC OSgo env
OutputWhat did you do? Run a simple module program in your golang page.
What did you expect to see? The file hello.go has a wrong reference to the greeting variable.
Please look at this file in https://golang.org/doc/tutorial/call-module-code.
What did you see instead?
package main
import (
"fmt"
"example.com/greetings"
)
func main() {
// Get a greeting message and print it.
message := greetings.Hello("Gladys")
fmt.Println(greeting) /* This should be message */ => it yields compilation error "./hello.go:12:17: undefined: greeting"
}
Please change it to
func main() {
// Get a greeting message and print it.
message := greetings.Hello("Gladys")
fmt.Println(message)
}
The text was updated successfully, but these errors were encountered: