1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
// Package modfile implements parsing and formatting for go.mod files.
//
// This is now just a simple forwarding layer over golang.org/x/mod/modfile
// apart from the ParseGopkgIn function which doesn't exist there.
//
// See that package for documentation.
//
// Deprecated: use [golang.org/x/mod/modfile] instead.
package modfile
import (
"golang.org/x/mod/modfile"
)
type Position = modfile.Position
type Expr = modfile.Expr
type Comment = modfile.Comment
type Comments = modfile.Comments
type FileSyntax = modfile.FileSyntax
type CommentBlock = modfile.CommentBlock
type Line = modfile.Line
type LineBlock = modfile.LineBlock
type LParen = modfile.LParen
type RParen = modfile.RParen
type File = modfile.File
type Module = modfile.Module
type Go = modfile.Go
type Require = modfile.Require
type Exclude = modfile.Exclude
type Replace = modfile.Replace
type VersionFixer = modfile.VersionFixer
func Format(f *FileSyntax) []byte {
return modfile.Format(f)
}
func ModulePath(mod []byte) string {
return modfile.ModulePath(mod)
}
func Parse(file string, data []byte, fix VersionFixer) (*File, error) {
return modfile.Parse(file, data, fix)
}
func ParseLax(file string, data []byte, fix VersionFixer) (*File, error) {
return modfile.ParseLax(file, data, fix)
}
func IsDirectoryPath(ns string) bool {
return modfile.IsDirectoryPath(ns)
}
func MustQuote(s string) bool {
return modfile.MustQuote(s)
}
func AutoQuote(s string) string {
return modfile.AutoQuote(s)
}
|