一个go语言开发的简单易用excel工具包
easyexcel旨在提供一个简单易用的excel工具包,让开发人员仅通过go结构体tags就能实现excel的导入与导出
go get github.com/kexin8/easyexcel
package main
import (
"fmt"
"github.com/kexin8/easyexcel"
)
type User struct {
Name string `excel:"name:姓名"`
Age int `excel:"name:年龄"`
Sex int `excel:"name:性别;convertExp:0=男,1=女,2=未知"`
Money float64 `excel:"name:金额"`
}
func main() {
users, err := easyexcel.Import[User]("User.xlsx", easyexcel.NewOption())
if err != nil {
fmt.Println(err)
return
}
for _, user := users {
fmt.Print("% v",user)
}
}
PRs accepted.
Small note: If editing the README, please conform to the standard-readme specification.
This program is under the terms of the BSD 3-Clause License. See https://opensource.org/licenses/BSD-3-Clause.