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

contextio

package
v0.1.6 Latest Latest
Warning

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

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

Documentation

Overview

Package contextio 在读写边界检查取消,不负责中断底层已经阻塞的 I/O。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Reader

func Reader(ctx context.Context, input io.Reader) io.Reader

Reader 在每次读取前后检查 ctx,取消时原样返回 ctx.Err()。 不可取消的上下文直接复用 input;同一上下文不会重复包装。

func Writer

func Writer(ctx context.Context, output io.Writer) io.Writer

Writer 在每次写入前后检查 ctx,取消时原样返回 ctx.Err()。 保留字符串写入快速路径;同一上下文不会重复包装。

Types

This section is empty.

Jump to

Keyboard shortcuts

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