package modfile
import "cuelang.org/go/internal/mod/modfile"
Index ¶
- type Dep
- type File
- func Parse(modfile []byte, filename string) (*File, error)
- func ParseLegacy(modfile []byte, filename string) (*File, error)
- func ParseNonStrict(modfile []byte, filename string) (*File, error)
- func (f *File) DepVersions() []module.Version
- type Language
Types ¶
type Dep ¶
type File ¶
type File struct { Module string `json:"module"` Language Language `json:"language"` Deps map[string]*Dep `json:"deps,omitempty"` // contains filtered or unexported fields }
func Parse ¶
Parse verifies that the module file has correct syntax. The file name is used for error messages. All dependencies must be specified correctly: with major versions in the module paths and canonical dependency versions.
func ParseLegacy ¶
ParseLegacy parses the legacy version of the module file that only supports the single field "module" and ignores all other fields.
func ParseNonStrict ¶
ParseNonStrict is like Parse but allows some laxity in the parsing:
- if a module path lacks a version, it's taken from the version.
- if a non-canonical version is used, it will be canonicalized.
The file name is used for error messages.
func (*File) DepVersions ¶
DepVersions returns the versions of all the modules depended on by the file. The caller should not modify the returned slice.
type Language ¶
type Language struct { Version string `json:"version"` }
Source Files ¶
modfile.go
- Version
- v0.7.1
- Published
- Feb 12, 2024
- Platform
- windows/amd64
- Imports
- 10 packages
- Last checked
- 48 minutes ago –
Tools for package owners.