Files
deep_go/lessons/errors/error_with_stacktrace/main.go

20 lines
263 B
Go
Raw Normal View History

package main
import (
"fmt"
"github.com/pkg/errors"
)
func main() {
value, err := DoSomething()
if err != nil {
fmt.Printf("%+v", err)
}
fmt.Println(value)
}
func DoSomething() (string, error) {
return "", errors.New("some error explanation here")
}