gomodulepath

package
v0.22.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package gomodulepath implements functions for the manipulation of Go module paths. Paths are typically defined as a domain name and a path containing the user and repository names, e.g. "github.com/username/reponame", but Go also allows other module names like "domain.com/name", "name", "namespace/name", or similar variants.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractAppPath added in v0.21.0

func ExtractAppPath(path string) string

ExtractAppPath extracts the app module path from a Go module path.

Types

type Path

type Path struct {
	// Path is Go module's full path.
	// e.g.: github.com/ignite-hq/cli.
	RawPath string

	// Root is the root directory name of Go module.
	// e.g.: cli for github.com/ignite-hq/cli.
	Root string

	// Package is the default package name for the Go module that can be used
	// to host main functionality of the module.
	// e.g.: cli for github.com/ignite-hq/cli.
	Package string
}

Path represents a Go module's path.

func Find

func Find(path string) (parsed Path, appPath string, err error)

Find search the Go module in the current and parent paths until finding it.

func Parse

func Parse(rawpath string) (Path, error)

Parse parses rawpath into a module Path.

func ParseAt

func ParseAt(path string) (Path, error)

ParseAt parses Go module path of an app resides at path.

Jump to

Keyboard shortcuts

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