package util

import "github.com/jdkato/prose/internal/util"

Package util contains internals used across the other prose packages.

Index

Functions

func CheckError

func CheckError(err error)

CheckError panics if `err` is not `nil`.

func ContainsAny

func ContainsAny(a string, b []string) bool

ContainsAny determines if the string a contains any fo the strings contained in the slice b.

func HasAnySuffix

func HasAnySuffix(a string, slice []string) bool

HasAnySuffix determines if the string a has any suffixes contained in the slice b.

func IsAlnum

func IsAlnum(c byte) bool

IsAlnum determines if a character is a letter or a digit.

func IsLetter

func IsLetter(c byte) bool

IsLetter determines if a character is letter.

func IsPunct

func IsPunct(c byte) bool

IsPunct determines if a character is a punctuation symbol.

func IsSpace

func IsSpace(c byte) bool

IsSpace determines if a character is a whitespace character.

func Min

func Min(a, b int) int

Min returns the minimum of `a` and `b`.

func ReadDataFile

func ReadDataFile(path string) []byte

ReadDataFile reads data from a file, panicking on any errors.

func StringInSlice

func StringInSlice(a string, slice []string) bool

StringInSlice determines if `slice` contains the string `a`.

Source Files

util.go

Version
v1.2.1 (latest)
Published
Dec 22, 2020
Platform
darwin/amd64
Imports
3 packages
Last checked
2 hours ago

Tools for package owners.