safe

package module
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

README

safe

PkgGoDev License build and test Go Report Card Coverage

safe provides a concurrency-safe safe.Buffer io.Writer for use in unit testing, without setting off Go's race detector.

DevContainer

[!CAUTION]

Do not use VSCode's "Dev Containers: Clone Repository in Container Volume" command, as it is utterly broken by design, ignoring .devcontainer/devcontainer.json.

  1. git clone https://github.com/thediveo/safe
  2. in VSCode: Ctrl+Shift+P, "Dev Containers: Open Workspace in Container..."
  3. select safe.code-workspace and off you go...

Supported Go Versions

safe supports versions of Go that are noted by the Go release policy, that is, major versions N and N-1 (where N is the current major version).

Contributing

Please see CONTRIBUTING.md.

safe is Copyright 2024, 2026 Harald Albrecht, and licensed under the Apache License, Version 2.0.

Documentation

Overview

Package safe provides a concurrency-safe buffer io.Writer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer

type Buffer struct {
	// contains filtered or unexported fields
}

Buffer is the concurrency-safe variant of bytes.Buffer.

func (*Buffer) String

func (b *Buffer) String() string

String returns the current contents of the buffer.

func (*Buffer) Write

func (b *Buffer) Write(p []byte) (n int, err error)

Write the contents specified in p to the buffer, returning the amount of bytes written.

Jump to

Keyboard shortcuts

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