How to get underlying value from a reflect.Value in golang?

前端 未结 4 1519
星月不相逢
星月不相逢 2021-02-02 08:02

So I found some code that help me get started with reflection in Go (golang), but I\'m having trouble getting a the underlying value so that I can basically create a map[s

4条回答
  •  逝去的感伤
    2021-02-02 08:11

    Another simple solution can be ,

    flavorName = fmt.Sprintf("%v",strct)
    

    " fmt.Sprintf() " will return the value which can be stored in a variable.

提交回复
热议问题