Documentation ¶
Index ¶
- func CompatibleTypes(expected types.Type, actual types.Type) error
- func ImportPathForDir(dir string) (res string)
- func NameForDir(dir string) string
- func NameForPackage(importPath string) string
- func NormalizeVendor(pkg string) string
- func PkgAndType(name string) (string, string)
- func QualifyPackagePath(importPath string) string
- func SanitizePackageName(pkg string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompatibleTypes ¶
CompatibleTypes isnt a strict comparison, it allows for pointer differences
func ImportPathForDir ¶
ImportPathForDir takes a path and returns a golang import path for the package
func NameForDir ¶ added in v0.9.0
NameForDir manually looks for package stanzas in files located in the given directory. This can be much faster than having to consult go list, because we already know exactly where to look.
func NameForPackage ¶
NameForPackage returns the package name for a given import path. This can be really slow.
func NormalizeVendor ¶
NormalizeVendor takes a qualified package path and turns it into normal one. eg . github.com/foo/vendor/github.com/99designs/gqlgen/graphql becomes github.com/99designs/gqlgen/graphql
func PkgAndType ¶
take a string in the form github.com/package/blah.Type and split it into package and type
func QualifyPackagePath ¶
QualifyPackagePath takes an import and fully qualifies it with a vendor dir, if one is required. eg . github.com/99designs/gqlgen/graphql becomes github.com/foo/vendor/github.com/99designs/gqlgen/graphql
x/tools/packages only supports 'qualified package paths' so this will need to be done prior to calling it See https://github.com/golang/go/issues/30289
func SanitizePackageName ¶
Types ¶
This section is empty.