mirror of
https://github.com/hanzoai/yaegi.git
synced 2026-10-01 00:49:47 +00:00
24 lines
356 B
Go
24 lines
356 B
Go
package main
|
|
|
|
import (
|
|
"errors"
|
|
)
|
|
|
|
func ShortVariableDeclarations() (i int, err error) {
|
|
r, err := 1, errors.New("test")
|
|
i = r
|
|
return
|
|
}
|
|
|
|
func main() {
|
|
_, er := ShortVariableDeclarations()
|
|
if er != nil {
|
|
println("ShortVariableDeclarations ok")
|
|
} else {
|
|
println("ShortVariableDeclarations not ok")
|
|
}
|
|
}
|
|
|
|
// Output:
|
|
// ShortVariableDeclarations ok
|