ammario / prefixsuffix

Exported os/exec.prefixSuffixSaver

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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
}

About

Exported os/exec.prefixSuffixSaver

License:MIT License


Languages

Language:Go 100.0%