Skip to content

There should be no print's in init functions #258

@rminnich

Description

@rminnich

Describe the issue

In the clock code for linux, there is a print.

This means that any command that includes this package will have a spurious print. This is a big problem
for, e.g, u-root.

Expected behavior

The package should not print.

Minimal code example to reproduce the issue

include this package in an command (u-root/cmds/exp/tc is an example). Run it. Note that on some kernels
it will print.

Consider make the two clocks variables functions and using once.Do to read the file in /proc.
You might also want to have a Must variant indicating that the variables must come from /proc.

In any event, there should not be a print function in an init() function in a package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions