Copyright 2011 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

package xerrors

import 
errorString is a trivial implementation of error.
type errorString struct {
	s     string
	frame Frame
}
New returns an error that formats as the given text. The returned error contains a Frame set to the caller's location and implements Formatter to show this information when printed with details.
func ( string) error {
	return &errorString{, Caller(1)}
}

func ( *errorString) () string {
	return .s
}

func ( *errorString) ( fmt.State,  rune) { FormatError(, , ) }

func ( *errorString) ( Printer) ( error) {
	.Print(.s)
	.frame.Format()
	return nil