Skip to content

x/website: "Random greeting" tutorial says code should have "init" method but no "init" method in the code #61140

Closed as not planned
@pt7481

Description

@pt7481

What is the URL of the page with the issue?

https://go.dev/doc/tutorial/random-greeting

What is your user agent?

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36

Screenshot

Screen Shot 2023-07-01 at 5 27 20 PM

What did you do?

Just load the page.

What did you expect to see?

The tutorial says the greetings.go code should include an "init" method per the following bullet:

  • "Add an init function to seed the rand package with the current time. Go executes init functions automatically at program startup, after global variables have been initialized. For more about init functions, see Effective Go."

Given the above, I expected to see an "init" function in the greetings.go code.

What did you see instead?

I did not see an "init" function in the greetings.go code.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions