Skip to content

tim-online/go-xlsx-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go XLSX template

This package combines the go text/template with tealeg/xlsx.

The endresult is that you can use Go's template language to fill an XLSX documents with data.

Example

package main

import (
	"github.com/tealeg/xlsx"
	"github.com/tim-online/go-xlsx-template"
)

f, err := xlsx.OpenFile("template.xlsx")
if err != nil {
	panic(err)
}

sheet := f.Sheets[0]
tmpl := template.New(sheet)

data := map[string]interface{}{
	"placeholder1": "Value 1",
	"placeholder2": "Value 2",
}

err = tmpl.Execute(data)
if err != nil {
	panic(err)
}

About

Go xlsx templates

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages