Skip to content

Set data with struct tag #619

@llqgit

Description

@llqgit

Description
有没有 struct tag 写法,把 []Data 这种直接写入 xlsx(带 title)

文档里没找到有相关写法,框架不支持?
文档看了一遍,根本不知道咋用,难道每一条都需要写

func (f *File) SetCellValue(sheet, axis string, value interface{}) error

都要用 for 循环设置?

我想用

type Data struct {
  Name string `json:"name" xlsx:"name"`
}

// export 导出整个数组
// []Data

不知道是不是真的没有这种写法?
有几个框架都支持了。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions