Categorygithub.com/ammario/prefixsuffix
modulepackage
0.0.0-20200405191514-5a0456bf2cfd
Repository: https://github.com/ammario/prefixsuffix.git
Documentation: pkg.go.dev

# README

prefixsuffix

GoDoc

Exported os/exec.prefixSuffixSaver.

// Saver is an io.Writer which retains the first N bytes
// and the last N bytes written to it. The Bytes() methods reconstructs
// it with a pretty error message.
type Saver struct {
    N         int // max size of prefix or suffix
    // ...
}

Basic Usage

func something() {
    s := &prefixsuffix.Saver{N: 4}
    io.WriteString(s, "1234 --- 5678")
    fmt.Printf("%s\n", s.Bytes())   
    // 1234
    // ... omitting 5 bytes ...
    // 5678
}

# Structs

Saver is an io.Writer which retains the first N bytes and the last N bytes written to it.