Skip to content

Instantly share code, notes, and snippets.

@mafredri
Created February 13, 2016 12:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mafredri/80d76e7672e84d33be8c to your computer and use it in GitHub Desktop.
Save mafredri/80d76e7672e84d33be8c to your computer and use it in GitHub Desktop.
tealeg/xlsx PR #149 breaking change demonstration
package main
import "github.com/tealeg/xlsx"
func main() {
file := xlsx.NewFile()
sheet, err := file.AddSheet("Sheet1")
if err != nil {
panic(err.Error())
}
row := sheet.AddRow()
cell := row.AddCell()
cell.Merge(1, 0)
style := cell.GetStyle()
style.Border.Top = "medium"
style.Border.Bottom = "medium"
style.Border.Left = "medium"
style.ApplyBorder = true
cell = row.AddCell()
style = cell.GetStyle()
style.Border.Top = "medium"
style.Border.Bottom = "medium"
style.Border.Right = "medium"
style.ApplyBorder = true
err = file.Save("./foo.xlsx")
if err != nil {
panic(err.Error())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment