golang 方法参数为interface 怎么引用?

studyseo · · 3638 次点击
这是调用代码 感觉很不完善 ```go package manage import ( "ask/dd" "ask/model" "ask/ot" "github.com/gin-gonic/gin" ) func NodeList(c *gin.Context) { node_list := []model.Node{} dd.Find(dd.FindConstructor{}, &node_list) c.JSON(200, ot.Success(node_list, "")) } ```
#6
更多评论
```go package main import ( "encoding/json" "fmt" ) type s struct { } func main() { a2 := "12435" a(&a2) fmt.Println(a2) a1_str := map[string]string{ "a":"233", } a1_map := map[string]string{} a1(a1_str,&a1_map) fmt.Println("map 值",a1_map) } func a1( s map[string]string,smap interface{}) { mb, _ := json.Marshal(s) json.Unmarshal(mb,&smap) } func a(ap interface{}) { ap = 5 } ``` ```hash //运行结果 12435 map 值 map[a:233] ``` 忘解惑
#1
``` 12435 map 值 map[a:233] ```
#2