random

package
v1.3.11 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandString

func RandString(n int, sources ...string) (string, error)

RandString returns a new string. if `source` is empty, the string is automatically generated from `defaultLetters`, otherwise its is generated from the `source` string, eg:

  1. automatically generated from default letters str, err := RandString(5) if err != nil { panic(err) // panic or logging }

  2. specify the source string str, err := RandString(10, "abcdef") if err != nil { log.Fatal(err) }

Types

This section is empty.

Jump to

Keyboard shortcuts

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