iox

package
v1.6.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidSource = errors.New("invalid source")
)

Functions

func ReadSource

func ReadSource(src any) ([]byte, error)

ReadSource converts src to a []byte if possible; otherwise it returns an error. Supported types for src are:

  • string (as content, NOT as filename)
  • []byte (as content)
  • *bytes.Buffer (as content)
  • io.Reader (as content)

func ReadSourceLocal

func ReadSourceLocal(filename string, src any) ([]byte, error)

If src != nil, ReadSourceLocal converts src to a []byte if possible; otherwise it returns an error. If src == nil, ReadSourceLocal returns the result of reading the file specified by filename.

Types

This section is empty.

Jump to

Keyboard shortcuts

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