Versions in this module Expand all Collapse all v1 v1.0.0 Jan 7, 2020 Changes in this version + func AutoQuote(s string) string + func Format(f *FileSyntax) []byte + func IsDirectoryPath(ns string) bool + func ModulePath(mod []byte) string + func MustQuote(s string) bool + func ParseGopkgIn(path string) (root, repo, major, subdir string, ok bool) + type Comment struct + Start Position + Suffix bool + Token string + type CommentBlock struct + Start Position + func (x *CommentBlock) Span() (start, end Position) + type Comments struct + After []Comment + Before []Comment + Suffix []Comment + func (c *Comments) Comment() *Comments + type Exclude struct + Mod module.Version + Syntax *Line + type Expr interface + Comment func() *Comments + Span func() (start, end Position) + type File struct + Exclude []*Exclude + Go *Go + Module *Module + Replace []*Replace + Require []*Require + Syntax *FileSyntax + func Parse(file string, data []byte, fix VersionFixer) (*File, error) + func ParseLax(file string, data []byte, fix VersionFixer) (*File, error) + func (f *File) AddComment(text string) + func (f *File) AddExclude(path, vers string) error + func (f *File) AddModuleStmt(path string) error + func (f *File) AddNewRequire(path, vers string, indirect bool) + func (f *File) AddReplace(oldPath, oldVers, newPath, newVers string) error + func (f *File) AddRequire(path, vers string) error + func (f *File) Cleanup() + func (f *File) DropExclude(path, vers string) error + func (f *File) DropReplace(oldPath, oldVers string) error + func (f *File) DropRequire(path string) error + func (f *File) Format() ([]byte, error) + func (f *File) SetRequire(req []*Require) + func (f *File) SortBlocks() + type FileSyntax struct + Name string + Stmt []Expr + func (x *FileSyntax) Cleanup() + func (x *FileSyntax) Span() (start, end Position) + type Go struct + Syntax *Line + Version string + type LParen struct + Pos Position + func (x *LParen) Span() (start, end Position) + type Line struct + End Position + InBlock bool + Start Position + Token []string + func (x *Line) Span() (start, end Position) + type LineBlock struct + LParen LParen + Line []*Line + RParen RParen + Start Position + Token []string + func (x *LineBlock) Span() (start, end Position) + type Module struct + Mod module.Version + Syntax *Line + type Position struct + Byte int + Line int + LineRune int + type RParen struct + Pos Position + func (x *RParen) Span() (start, end Position) + type Replace struct + New module.Version + Old module.Version + Syntax *Line + type Require struct + Indirect bool + Mod module.Version + Syntax *Line + type VersionFixer func(path, version string) (string, error)