Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunAndCaptureOutput ¶
RunAndCaptureOutput runs the command and returns its stdout as a byte slice. If the output is not valid UTF-8 text, this returns an error.
func RunInTerminal ¶
RunInTerminal runs the command using inputs and outputs of the current process.
Types ¶
type FileLocation ¶
type FileLocation struct { Path string // Path to the file. LineNum uint64 // Line number in the file. Snippet string // Snippet of text from the location. }
FileLocation represents a location within a file.
func FileLocationsFromLines ¶
func FileLocationsFromLines(r io.Reader) ([]FileLocation, error)
FileLocationsFromLines parses each non-empty line as a file location. The supported file location formats are:
<file>:<line>:<col>:<snippet> <file>:<line>:<snippet>
which correspond to the outputs to `grep -n` and `ripgrep --vimgrep` If any line cannot be parsed, this function aborts and returns an error.
Click to show internal directories.
Click to hide internal directories.