Skip to content

A go program development with a simple and efficient excel toolkit

License

Notifications You must be signed in to change notification settings

kexin8/easyexcel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

easyexcel

standard-readme compliant https://opensource.org/licenses/MIT Go Reference

一个go语言开发的简单易用excel工具包

Table of Contents

Background

easyexcel旨在提供一个简单易用的excel工具包,让开发人员仅通过go结构体tags就能实现excel的导入与导出

Install

go get github.com/kexin8/easyexcel

Usage

Import

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)
    }
}

API

Maintainers

@kexin8

Contributing

PRs accepted.

Small note: If editing the README, please conform to the standard-readme specification.

License

This program is under the terms of the BSD 3-Clause License. See https://opensource.org/licenses/BSD-3-Clause.

About

A go program development with a simple and efficient excel toolkit

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages