Thanks to visit codestin.com
Credit goes to pkg.go.dev

sample

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultSampleFunc = func(rate float64) bool {
	if rate < 0 {
		rate = 0
	} else if rate > 1 {
		rate = 1
	}
	return random.CFloat64() <= rate
}

DefaultSampleFunc the default random sample function

Functions

This section is empty.

Types

type SampleFunc

type SampleFunc func(rate float64) bool

SampleFunc the random sample function

Jump to

Keyboard shortcuts

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