Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrPathEscapesBase = errors.New("path escapes base directory")
ErrPathEscapesBase is returned when a path is outside the expected base directory.
Functions ¶
func EnsureSubPath ¶ added in v0.45.0
EnsureSubPath returns an error if path is not contained within base. This prevents path traversal attacks where user-controlled data could escape the intended directory.
func IsSimilarWord ¶
IsSimilarWord calculates "The Levenshtein Distance" between two strings which represents the minimum total cost of edits that would convert the first string into the second. If the distance is less than 3, the word is considered misspelled.
func RemoveIgnoreNonExistent ¶ added in v0.28.0
RemoveIgnoreNonExistent removes a file, ignoring if it doesn't exist.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.