nosleep

package
v1.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2024 License: CC0-1.0 Imports: 6 Imported by: 0

Documentation

Overview

Package nosleep contains a Go linter that prevents the use of time.Sleep in tests.

Time is not a synchronization mechanism. It is not an appropriate thing to use in tests because undoubtedly the thing you are synchronizing on is going to depend on some unspoken assumption that can and will randomly change. Do something else.

If god is dead and you need to do this anyways, add a comment that reads:

//nosleep:bypass put a reason why here

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name: "nosleep",
	Doc:  "Prevent the use of time.Sleep in test functions",
	Run:  run,
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL