Help us shape the future of Go! Take the 2026 Go Developer Survey

gomod

package
v1.12.0-dev.3 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package gomod reads the path a Go module publishes itself under from the go.mod file that governs a directory, the way the go command finds and reads that file, and reads nothing else of it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Path

func Path(dir string) (path string, found bool, err error)

Path is the module path of the Go module holding dir: the module directive of the go.mod file in dir, or else in the nearest directory above it, which is the file the go command takes as the main module's for a build in dir. found is false where no directory up to the filesystem root holds one.

A go.mod file that cannot be read, or whose module directive is absent or holds no module path the go.mod grammar admits, is an error naming the file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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