module

package
v0.0.0-...-2fc3053 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbsolutePath

func AbsolutePath(m Module, filePath string) (string, bool)

AbsolutePath checks if filePath exists in module and provides absolute path to the file For example: Module.Root - /home/<some-home>/go/src/github.com/bincooo/go-annotation Module.Files - [internal/module/lookup.go...] filePath - github.com/bincooo/go-annotation/internal/module/module.go return - /home/<some-home>/go/src/github.com/bincooo/go-annotation/internal/module/module.go

func FilesInDir

func FilesInDir(m Module, dir string) []string

FilesInDir finds all files in a particular directory for Module For example: Module.Root - /home/<some-home>/go/src/github.com/bincooo/go-annotation Module.Files - [internal/lookup/imports.go...] dir - internal/lookup Then the function returns all files in internal/lookup dir with no prefixes:

"internal/lookup/imports.go"
"internal/lookup/imports_test.go"
"internal/lookup/types.go"
"internal/lookup/types_test.go"

func FilesInPackage

func FilesInPackage(m Module, importPath string) []string

FilesInPackage finds all files in importPath for Module For example: Module.Root - /home/<some-home>/go/src/github.com/bincooo/go-annotation Module.Files - [internal/module/lookup.go...] importPath - github.com/bincooo/go-annotation/internal/module Then the function returns all files in internal/module dir with package prefix:

"github.com/bincooo/go-annotation/internal/module/load.go"
"github.com/bincooo/go-annotation/internal/module/interface.go"
"github.com/bincooo/go-annotation/internal/module/interface_test.go"
"github.com/bincooo/go-annotation/internal/module/lookup.go"
"github.com/bincooo/go-annotation/internal/module/module.go"

func Mod

func Mod(m Module) *modfile.File

Types

type Module

type Module interface {
	Root() string
	LocalPackageOf(path string) string
	Files() []string
}

func Find

func Find(m Module, importPath string) (Module, error)

func Load

func Load(path string) (Module, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL