module

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: MIT Imports: 12 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/YReshetko/go-annotation Module.Files - [internal/module/lookup.go...] filePath - github.com/YReshetko/go-annotation/internal/module/module.go return - /home/<some-home>/go/src/github.com/YReshetko/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/YReshetko/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/YReshetko/go-annotation Module.Files - [internal/module/lookup.go...] importPath - github.com/YReshetko/go-annotation/internal/module Then the function returns all files in internal/module dir with package prefix:

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

Types

type Module

type Module interface {
	Root() 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