iohelper

package module
v0.0.0-...-27114c6 Latest Latest
Warning

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

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

README

iohelper

Build Status Coverage Status GoDoc

Subpackages: ioutilhelper GoDoc

Helpers for GoLang packages "io" & "ioutil".

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToGoArraySource

func BytesToGoArraySource(b []byte, w io.Writer) error

BytesToGoArraySource is similar to BytesToGoSliceSource but generate array instead of slice. Example: for b=[]byte{0x01, 0x02, 0x03} BytesToGoSliceSource write "[3]byte{0x01, 0x02, 0x03}" AS STRING.

func BytesToGoSliceSource

func BytesToGoSliceSource(b []byte, w io.Writer) error

BytesToGoSliceSource convert given slice of bytes to GoLang source code representation and write it to given io.Writer. Example: for b=[]byte{0x01, 0x02, 0x03} BytesToGoSliceSource write "[]byte{0x01, 0x02, 0x03}" AS STRING. This function may be useful with "//go:generate" directive to include some (binary) files into app at compile time.

func Write

func Write(w io.Writer, data ...[]byte) (int, error)

Write is io.Writer.Write but with variable number of arguments. Write stops writing after first error. Returns number of successfully wrote arguments and error.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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