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

testutil

package
v1.53.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Leveled added in v1.52.0

func Leveled(core zapcore.Core, enab zapcore.LevelEnabler) zapcore.Core

Leveled overrides a fixed-level core's level decisions with enab.

func NewJSONCore added in v1.52.0

func NewJSONCore(ws zapcore.WriteSyncer, enab zapcore.LevelEnabler) zapcore.Core

Types

type BufferedWriteSyncer

type BufferedWriteSyncer struct {
	bytes.Buffer
}

func (*BufferedWriteSyncer) Sync

func (t *BufferedWriteSyncer) Sync() error

func (*BufferedWriteSyncer) Unmarshal

func (t *BufferedWriteSyncer) Unmarshal(v any) error

type CoreFactory added in v1.52.0

type CoreFactory = func(enab zapcore.LevelEnabler) zapcore.Core

zaputil's own tests import this package, so it must not import zaputil; callers build the Tee themselves.

func NewJSONCoreFactory added in v1.52.0

func NewJSONCoreFactory(ws zapcore.WriteSyncer) CoreFactory

func NewObserverCoreFactory added in v1.52.0

func NewObserverCoreFactory() (CoreFactory, *observer.ObservedLogs)

NewObserverCoreFactory records every entry the core is handed.

type TestLogOutput

type TestLogOutput struct {
	Level  string
	TS     float64
	Caller string
	Msg    string
}

Jump to

Keyboard shortcuts

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