utils

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2025 License: MIT Imports: 10 Imported by: 0

README

Utils

A collection of util function shareable between projects

File

Math

Text


Testing

The tool includes table-driven tests to ensure consistent behavior for a variety of inputs.

Run Tests:

go test ./test -v

Dependencies

Contributing

Contributions are welcome!

  1. Fork the repository.
  2. Create a new branch (feature/my-feature).
  3. Commit changes and submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChanceOf

func ChanceOf(probability float64) bool

ChanceOf returns true with the given probability (0.0 to 1.0)

func CloseFile

func CloseFile(closer io.Closer)

func FormatNumber

func FormatNumber(num float64) string

func Max

func Max(a, b int) int

func Min

func Min(a int, b int) int

func Normalize

func Normalize(input string) string

Normalize whitespace in Markdown output to avoid formatting mismatches

func ReadFile

func ReadFile(filePath string) (*bytes.Reader, error)

func ReadLines

func ReadLines(filename string) ([]string, error)

func RemoveAll

func RemoveAll(tempDir string)

func RemoveFile

func RemoveFile(filePath string)

func SaveFile

func SaveFile(outputDir string, fileName string, fileContent []byte) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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