scan

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiffLines added in v0.9.0

func DiffLines() func(data []byte, atEOF bool) (advance int, token []byte, err error)

DiffLines is a split function for a bufio.Scanner that splits a git diff output into multiple blocks of text, each prefixed by the diff --git marker. Each block of text will be stripped of any leading and trailing whitespace. If the git diff marker isn't detected, the entire block of text is returned, with any leading and trailing whitespace stripped

func PrefixedLines

func PrefixedLines(prefix byte) func(data []byte, atEOF bool) (advance int, token []byte, err error)

PrefixedLines is a split function for a bufio.Scanner that returns each block of text, stripped of both the prefix marker and any leading and trailing whitespace. If no prefix is detected, the original text will be treated as a single block of text, with any leading and trailing whitespace stripped

Types

This section is empty.

Jump to

Keyboard shortcuts

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