Standard library / archive/tar

archive/tar.ErrHeader

Invalid TAR header sentinel. Malformed input should be rejected. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
var ErrHeader error

Working Example

Example Snippetgo
package main
import (  "archive/tar"  "bytes"  "errors"  "fmt")
func must(e error) {  if e != nil {    panic(e)  }}
func main() {  r := tar.NewReader(bytes.NewReader(bytes.Repeat([]byte("x"), 512)))  _, e := r.Next()  fmt.Println(errors.Is(e, tar.ErrHeader))}
Go Reference