Skip to content

Commit dddd46d

Browse files
committed
random: update docs
The documentation incorrectly stated that we fall back to crypto/rand, while we actually used math/rand. In practice, the question of what source of randomness we are using is actually quite subtle. Just mention that this source of randomness integrates with the platform and don't specify what we do exactly for the fallback.
1 parent 1855c85 commit dddd46d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

random/random.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
//go:build !no_antithesis_sdk
22

3-
// Package random requests both structured and unstructured randomness from the Antithesis environment. is part of the [Antithesis Go SDK], which enables Go applications to integrate with the [Antithesis platform].
3+
// Package random is part of the [Antithesis Go SDK], which enables Go applications to integrate with the [Antithesis platform].
44
//
5-
// These functions should not be used to seed a conventional PRNG, and should not have their return values stored and used to make a decision at a later time. Doing either of these things makes it much harder for the Antithesis platform to control the history of your program's execution, and also makes it harder for Antithesis to learn which inputs provided at which times are most fruitful. Instead, you should call a function from the random package every time your program or [workload] needs to make a decision, at the moment that you need to make the decision.
5+
// Use these functions to generate pseudo-random data using [math/rand.Rand] while providing feedback to the platform.
66
//
7-
// These functions are also safe to call outside the Antithesis environment, where they will fall back on values from [crypto/rand].
7+
// Avoid storing random values to make a decision at a later time, as this makes it much harder for the Antithesis platform to control the history of your program's execution.
88
//
99
// [Antithesis Go SDK]: https://antithesis.com/docs/using_antithesis/sdk/go/
1010
// [Antithesis platform]: https://antithesis.com
11-
// [workload]: https://antithesis.com/docs/getting_started/first_test/
1211
package random
1312

1413
import (

0 commit comments

Comments
 (0)