facts

package
v0.0.0-...-0c3cbb8 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package facts serves a random fact from the embedded facts dataset. Call Load once at startup with the embed.FS from the parent package, then call Random from anywhere.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(fsys fs.FS) error

Load reads datasets/facts.txt from fsys into memory. Call once at startup. After Load returns nil, Random is safe for concurrent use.

func Random

func Random() string

Random returns a uniformly random fact. Returns "" if Load has not been called or the dataset 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