Documentation ¶
Index ¶
- Constants
- Variables
- func StandardLibraryURL(path string) (string, bool)
- func StdPackages(version string) (map[string]struct{}, error)
- func VendorRelativePath(path string) (string, bool)
- type GitHubFile
- type HttpClient
- type Module
- func (m Module) GithubFile() (GitHubFile, error)
- func (m Module) GoogleSourceURL() (string, error)
- func (m Module) IsGitHub() bool
- func (m Module) IsGoPkgIn() bool
- func (m Module) IsGoogleSource() bool
- func (module *Module) Resolve(ctx context.Context, mainModule module.Version, modfile *modfile.File, ...) error
- func (m Module) String() string
Constants ¶
const ( GoMod = "go.mod" GitHubPath = "github.com/" GooglePath = "go.googlesource.com/" GoPkgInPath = "gopkg.in/" )
Variables ¶
var StandardPackages = map[string]struct{}{}/* 261 elements not displayed */
Functions ¶
func StandardLibraryURL ¶
StandardLibraryURL returns the URL of the standard library package from the given local path if it exists.
func StdPackages ¶
StdPackages returns a map of all standard packages for the given version.
func VendorRelativePath ¶
VendorRelativePath returns the relative path of the given path if it is a vendor path. For example: /drone/src/vendor/google.golang.org/protobuf/proto/merge.go -> /vendor/google.golang.org/protobuf/proto/merge.go
Types ¶
type GitHubFile ¶
type GitHubFile struct {
Owner, Repo, Ref, Path string
}
type Module ¶
Module represents a go module with a file path in that module
func ParseModuleFromPath ¶
ParseModuleFromPath parses the module from the given path.
func (Module) GithubFile ¶
func (m Module) GithubFile() (GitHubFile, error)
GithubFile returns the github file information.
func (Module) GoogleSourceURL ¶
GoogleSourceURL returns the URL of the file in the google source repository. Example https://go.googlesource.com/oauth2/+/4ce7bbb2ffdc6daed06e2ec28916fd08d96bc3ea/amazon/amazon.go