utils

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EscapePath

func EscapePath(modPath string) (string, error)

EscapePath applies Go module path escaping (uppercase letters become !lowercase).

func NextMajorPath

func NextMajorPath(basePath string, major int) string

NextMajorPath builds the module path for the given major version, respecting the gopkg.in ".vN" convention vs the standard "/vN" convention.

func ParseModulePath

func ParseModulePath(modPath string) (basePath string, major int)

ParseModulePath splits a module path into its base path and current major version number.

Examples:

"github.com/user/gomodule/v2"  -> ("github.com/user/gomodule", 2)
"gopkg.in/yaml.v2"             -> ("gopkg.in/yaml", 2)
"github.com/google/uuid"       -> ("github.com/google/uuid", 1)

Types

This section is empty.

Jump to

Keyboard shortcuts

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