util

package
v0.18.5 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrFileEmpty is an error to signify the file is empty
	ErrFileEmpty = errors.New("file is empty")
	// ErrFileNotText is an error to signify the file type is not a text file that can be read
	ErrFileNotText = errors.New("file is not a text file")
	// ErrIsDir is an error to signify a directory
	ErrIsDir = errors.New("file is a directory")
)

Functions

func ContainsAlphanumeric

func ContainsAlphanumeric(s string) bool

ContainsAlphanumeric returns true if alphanumeric chars are found in the string

func FilterEmptyStrings

func FilterEmptyStrings(s []string) []string

func InSlice

func InSlice(s string, slice []string) bool

InSlice returns true if a string is found in the slice

func IsTextFile

func IsTextFile(file *os.File) error

IsTextFile returns an error if the file is not of content-type 'text/*'

func IsTextFileFromFilename

func IsTextFileFromFilename(filename string) error

IsTextFileFromFilename returns an error if the filename is not of content-type 'text/*'

func MarkdownCodify

func MarkdownCodify(s string) string

MarkdownCodify returns a markdown code string https://www.markdownguide.org/basic-syntax/#code

Types

This section is empty.

Jump to

Keyboard shortcuts

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