stream

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package stream provides real-time streaming display for go test -json output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, r io.Reader, out io.Writer, width, height int, style StyleFunc) int

Run reads go test -json events from r and renders them to out. Returns exit code: 0=all pass, 1=failures, 2=error.

Types

type LineKind

type LineKind int

LineKind identifies the type of output line for styling.

const (
	KindPass LineKind = iota
	KindFail
	KindSkip
	KindPkgPass
	KindPkgFail
	KindOutput
	KindSeparator
)

type StyleFunc

type StyleFunc func(kind LineKind, text string) string

StyleFunc formats a line with colors/symbols. If nil, no styling is applied.

Jump to

Keyboard shortcuts

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