interface类型数据转化string类型

  项目中,遇到一个问题,将struct结构转化成一个map 

  使用structs.Map(&Info) 成为一个map :m1

  接着m1 根据key值获取出来的是interface类型的数据,

  需要将interface类型的数据转化成string类型,进行赋值

  用到的包有:

  •     结构体转化map:github.com/fatih/structs   
  •     interface类型转换成string:github.com/spf13/cast 
  •     存储excel文件: github.com/tealeg/xlsx
posted @ 2021-06-09 16:54  pebblecome  阅读(1787)  评论(0)    收藏  举报