Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/website: error in documentation example #41168

Closed
ckharide opened this issue Sep 1, 2020 · 2 comments
Closed

x/website: error in documentation example #41168

ckharide opened this issue Sep 1, 2020 · 2 comments

Comments

@ckharide
Copy link

ckharide commented Sep 1, 2020

What version of Go are you using (go version)? 1.15

$ go version

Does this issue reproduce with the latest release?

What operating system and processor architecture are you using (go env)? MAC OS

go env Output
$ go env

What 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)
}

@ianlancetaylor ianlancetaylor changed the title Documentation example x/website: error in documentation example Sep 1, 2020
@gopherbot gopherbot added this to the Unreleased milestone Sep 1, 2020
@ianlancetaylor
Copy link
Contributor

I think this needs to be fixed in golang.org/x/website/content/static/doc/tutorial.

@dmitshur
Copy link
Contributor

dmitshur commented Sep 2, 2020

Thanks for reporting. This is a duplicate of #41150 and there’s a fix already sent out.

@dmitshur dmitshur closed this as completed Sep 2, 2020
@golang golang locked and limited conversation to collaborators Sep 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants