Skip to content

Commit

Permalink
excel generate
Browse files Browse the repository at this point in the history
  • Loading branch information
mvrpl committed May 19, 2024
1 parent 9ec455e commit 3409e60
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
15 changes: 15 additions & 0 deletions generate_report.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/dustin/go-humanize"
"github.com/goodsign/monday"
"github.com/syndtr/goleveldb/leveldb"
"github.com/xuri/excelize/v2"
"golang.org/x/text/cases"
"golang.org/x/text/language"
)
Expand Down Expand Up @@ -206,4 +207,18 @@ func GenReport(monthYear time.Time) {
if err != nil {
panic(err)
}

f := excelize.NewFile()
defer f.Close()

_, err = f.NewSheet(montYer)
if err != nil {
panic(err)
}

f.SetCellValue(montYer, "A2", "Hello world.")

if err := f.SaveAs("speed_tests.xlsx"); err != nil {
panic(err)
}
}
12 changes: 8 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,25 @@ module mvrpl.dev/speed-test
go 1.20

require (
github.com/ConvertAPI/convertapi-go v0.0.0-20230704115642-e0ca20c26892
github.com/dustin/go-humanize v1.0.1
github.com/goodsign/monday v1.0.1
github.com/showwin/speedtest-go v1.6.3
github.com/syndtr/goleveldb v1.0.0
github.com/urfave/cli/v2 v2.25.7
github.com/xuri/excelize/v2 v2.7.1
golang.org/x/text v0.11.0
)

require (
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/richardlehane/mscfb v1.0.4 // indirect
github.com/richardlehane/msoleps v1.0.3 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/stretchr/testify v1.7.1 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
golang.org/x/net v0.6.0 // indirect
github.com/xuri/efp v0.0.0-20220603152613-6918739fd470 // indirect
github.com/xuri/nfp v0.0.0-20220409054826-5e722a1d9e22 // indirect
golang.org/x/crypto v0.8.0 // indirect
golang.org/x/net v0.9.0 // indirect
)

0 comments on commit 3409e60

Please sign in to comment.