A Go package that returns True. If you want it to be more true, you can have it work harder to verify that it's true, however, the answer will always be true.
To install the package, run:
go get github.com/teamcoltra/go-generatetruthThen, import it in your Go code:
import "github.com/teamcoltra/go-generatetruth"package main
import (
"fmt"
"time"
"github.com/teamcoltra/go-generatetruth"
)
func main() {
for i := 1; i <= 10; i++ {
start := time.Now()
result, err := reliabletruth.GenerateTruth(2000)
duration := time.Since(start)
if err != nil {
fmt.Printf("Try %d: ERROR - %s (Took %v)\n", i, err, duration)
} else {
fmt.Printf("Try %d: Result = %v (Took %v)\n", i, result, duration)
}
}
}Try 1: Result = true (Took 8.3244708s)
Try 2: Result = true (Took 8.7674859s)
Try 3: Result = true (Took 5.3801424s)
Try 4: Result = true (Took 3.6344316s)
Try 5: Result = true (Took 4.8420874s)
Try 6: Result = true (Took 2.3606915s)
Try 7: Result = true (Took 9.583106s)
Try 8: Result = true (Took 10.6912197s)
Try 9: Result = true (Took 8.3651591s)
Try 10: Result = true (Took 2.8046043s)
- bits: The number of bits used for generating prime numbers. If set to
0, it defaults to 512 bits. - Returns:
- A boolean
true(indicating that truth was successfully generated). - An error if something goes wrong.
- A boolean
- bits: The number of bits used for the prime numbers generated (higher the number, the more truthyness).
This package is licensed under the YO License. See LICENSE for details.
Contributions are welcome! Feel free to open an issue or submit a pull request.