Standard library / compress/flate

compress/flate.WriteError

Deprecated wrapper containing Offset and underlying Err; modern writers do not normally return this type. Synthetic example only. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
type WriteError struct {  Offset int64  Err    error}

Working Example

Example Snippetgo
package main
import (  "compress/flate"  "fmt"  "io")
func must(e error) {  if e != nil {    panic(e)  }}
func main() {  var e error = &flate.WriteError{Offset: 4, Err: io.ErrShortWrite}  fmt.Println(e.Error() != "")}
Go Reference