mirror of
https://github.com/traefik/yaegi.git
synced 2026-06-01 18:37:56 +00:00
19 lines
215 B
Go
19 lines
215 B
Go
package main
|
|
|
|
import "fmt"
|
|
|
|
func f() (string, error) {
|
|
err := fmt.Errorf("a nice error")
|
|
return "", err
|
|
}
|
|
|
|
func main() {
|
|
_, err := f()
|
|
if err != nil {
|
|
fmt.Println(err.Error())
|
|
}
|
|
}
|
|
|
|
// Output:
|
|
// a nice error
|