packages

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package packages finds files related to a package pattern string.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilePath

func FilePath(fs hackpadfs.FS, workingDirectory, filePattern string, options Options) (pkgFile string, err error)

FilePath finds a package file's relative path inside the 'workingDirectory' of 'fs'.

Pass a file package pattern like "github.com/org/mymodule/myfile.go" or "./mymodule/myfile.go". If you would like to include more sources for the current Go build context, customize them with 'options'.

Types

type Options

type Options struct {
	// GoRoot sets a custom GOROOT on the current build context.
	// Defaults to no root. Paths are relative to the 'fs'.
	GoRoot string
	// GoPath appends custom GOPATH elements on the current build context.
	// Defaults to including the current Go Module in a pseudo-GOPATH directory. Paths are relative to the 'fs'.
	GoPath string
}

Options contains configurable options for calls to FilePath()

Jump to

Keyboard shortcuts

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