Help us shape the future of Go! Take the 2026 Go Developer Survey

excel

package
v1.21.83 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package excel renders and reads xlsx workbooks for clicky. It is the only clicky package importing excelize, so binaries that never touch spreadsheets don't compile it; opt in with Use().

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Use

func Use()

Use registers the "excel" and "xlsx" formats, the "excel" streaming writer and the reader behind @data.xlsx:Column flag values.

func WriteFile

func WriteFile(data any, path string) error

WriteFile renders data as an xlsx workbook at path.

Types

type Formatter

type Formatter struct {
	SheetName string
}

Formatter handles Excel file generation

func NewFormatter

func NewFormatter() *Formatter

NewFormatter creates a new Excel formatter

func (*Formatter) Format

func (f *Formatter) Format(data interface{}) (string, error)

Format renders data as the bytes of an xlsx workbook.

The string is binary, not text — callers write it verbatim (FormatToFile does, and a --format excel sink is a file). It is a string because that is the FormatterFunc contract every other format shares.

func (*Formatter) FormatPrettyData

func (f *Formatter) FormatPrettyData(data *api.PrettyData) (string, error)

FormatPrettyData formats PrettyData to Excel bytes (for in-memory operations)

func (*Formatter) FormatPrettyDataToFile

func (f *Formatter) FormatPrettyDataToFile(data *api.PrettyData, filename string, file *excelize.File) error

FormatPrettyDataToFile formats PrettyData into file and saves it to filename.

func (*Formatter) FormatToFile

func (f *Formatter) FormatToFile(data interface{}, filename string) error

FormatToFile creates an Excel file and saves it to the specified path

type Sheet

type Sheet struct {
	Name       string
	Provenance string
	Table      api.TextTable
}

type Workbook

type Workbook struct {
	Sheets []Sheet
}

Workbook renders as one worksheet per Sheet when passed to the excel format.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL