utils

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDefaultIgnore

func CheckDefaultIgnore(path string, info os.FileInfo, isVCS bool) bool

CheckDefaultIgnore returns true if the path should be ignored.

func CheckMD5Sum

func CheckMD5Sum(path string, fileCache *syncmap.SyncMap[string, struct{}]) bool

CheckMD5Sum checks if the file's MD5 sum is in the cache.

func CheckOptionMatch

func CheckOptionMatch(path string, info os.FileInfo, opts *option.GClocOptions) bool

CheckOptionMatch returns true if the path matches the options.

func CloneGitRepo added in v1.0.4

func CloneGitRepo(repoURL string) (string, error)

CloneGitRepo clones the git repository.

func ContainComment

func ContainComment(line string, multipleLines [][]string) bool

ContainComment returns true if the line contains a comment.

func FileExits

func FileExits(path string) bool

FileExits returns true if the file exists.

func IsGitURL added in v1.0.4

func IsGitURL(path string) bool

IsGitURL returns true if the path is a git URL.

func IsVCSDir

func IsVCSDir(path string) bool

IsVCSDir returns true if the path is a VCS directory.

func MD5Sum

func MD5Sum(path string) ([16]byte, error)

MD5Sum returns the MD5 sum of the file.

func NextRune

func NextRune(str string) rune

NextRune returns the next rune in the string.

func TrimBOM

func TrimBOM(line string) string

TrimBOM trims the UTF-8 BOM from the line.

Types

This section is empty.

Jump to

Keyboard shortcuts

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