New in Go

Posted by GoDoc
Public (Editable by Users)

New returns an error that formats as the given text. Each call to New returns a distinct error value even if the text is identical.

Go
Edit
package main

import (
	"errors"
	"fmt"
)

func main() {
	err := errors.New("emit macho dwarf: elf header corrupted")
	if err != nil {
		fmt.Print(err)
	}
}