mirror of
https://github.com/hanzoai/yaegi.git
synced 2026-10-01 00:49:47 +00:00
There should be no need now to wrap empty interfaces in order to retrieve its value. Fixes #1344.
14 lines
207 B
Go
14 lines
207 B
Go
package main
|
|
|
|
import "fmt"
|
|
|
|
func main() {
|
|
var m = map[string]interface{}{"a": "a"}
|
|
a, _ := m["a"]
|
|
b, ok := a.(string)
|
|
fmt.Println("a:", a, ", b:", b, ", ok:", ok)
|
|
}
|
|
|
|
// Output:
|
|
// a: a , b: a , ok: true
|