util

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCannotParseModuleName = errors.New("cannot parse module name from go.mod file")
View Source
var ErrNoGoMod = errors.New("no go.mod file found")

Functions

func ExtractModuleNameFromGoMod

func ExtractModuleNameFromGoMod(goModPath string) (string, error)

func FindGoModDir

func FindGoModDir(startDir string) (string, error)

FindGoModDir will find the directory containing the go.mod file for a project, starting with `startDir`.

If the file cannot be found in the current directory, it will traverse up each directory until it gets to the root directory, looking in each subsequent dir.

func GenerateRandomIdentifier

func GenerateRandomIdentifier() string

func GenerateRandomIdentifierWithRand

func GenerateRandomIdentifierWithRand(n *rand.Rand) string

func Int64FromString

func Int64FromString(x string) int64

func RandSourceFromString

func RandSourceFromString(x string) rand.Source

Types

This section is empty.

Jump to

Keyboard shortcuts

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