Skip to content

x/website: /doc/tutorial/random-greeting mentions a non-existing init function #61195

@cajund

Description

@cajund

What is the URL of the page with the issue?

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

What did you do?

On this page, there is a set of bullets, one being:

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.

However, there is no init() function in the example code.

What did you expect to see?

Either the init() function in the code, or the removal of this bullet. An explanation as to how rand is seeded may help as it appears the rand.Seed()` function is depreciated.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions