Help us shape the future of Go! Take the 2026 Go Developer Survey

files

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SpecsToSearchPatterns

func SpecsToSearchPatterns(fileSpecs FileSpecs) (searchPatterns []string)

func ToSearchPatterns

func ToSearchPatterns(fileNames []string) (searchPatterns []string)

Types

type File

type File struct {
	Name        string
	PkgFileName string
	Lines       []int
	Content     []byte
	Pos         token.Position
	End         token.Position
	LineRanges  []LineRange
}

func ExtractFile

func ExtractFile(
	t *testing.T,
	srcs *sources.SourcesData,
	file string,
) *File

func LoadFiles

func LoadFiles(
	sources_data *sources.SourcesData,
	fileSpecs FileSpecs,
	selectAllFiles bool,
) ([]*File, error)

func (*File) GetContent

func (f *File) GetContent(start, end int) string

func (*File) GetOffset

func (f *File) GetOffset(line, col int) int

func (*File) GetPosition

func (f *File) GetPosition(offset int) token.Position

type FileSpecs

type FileSpecs map[string][]LineRange

func ProcessNameArguments

func ProcessNameArguments(fileNames []string) (FileSpecs, error)

func ResolveFileNames

func ResolveFileNames(dir string, fileSpecs FileSpecs) (FileSpecs, error)

type LineRange

type LineRange struct {
	Start   int
	End     int
	Context set.Set[int]
}

Jump to

Keyboard shortcuts

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