Standard library / compress/bzip2

compress/bzip2.StructuralError.Error()

Return the formatted BZIP2 structural-error diagnostic. The demonstration uses a synthetic error value. Expected stdout: 'bzip2 data invalid: demo\n'.

Formal Syntax & Structure

go syntaxgo
func (s StructuralError) Error() string

Return Value

string

Human-readable diagnostic.

Working Example

Example Snippetgo
package main
import (  "compress/bzip2"  "fmt")
func must(e error) {  if e != nil {    panic(e)  }}
func main() { fmt.Println(bzip2.StructuralError("demo").Error()) }
Go Reference