...

Source file src/github.com/rogpeppe/go-internal/modfile/forward.go

Documentation: github.com/rogpeppe/go-internal/modfile

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

View as plain text