go(report/gen,tmpl): use more meaningful var names
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
3e641e0906
commit
ab850f6c2c
@ -14,7 +14,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
columns := []string{
|
// colAlign sets the alignment of latex table columns.
|
||||||
|
colAlign := []string{
|
||||||
"l",
|
"l",
|
||||||
"c",
|
"c",
|
||||||
"c",
|
"c",
|
||||||
@ -30,7 +31,7 @@ func main() {
|
|||||||
-4.466,
|
-4.466,
|
||||||
66.0008,
|
66.0008,
|
||||||
}
|
}
|
||||||
topics := []string{
|
colNames := []string{
|
||||||
"func name",
|
"func name",
|
||||||
"min",
|
"min",
|
||||||
"max",
|
"max",
|
||||||
@ -55,14 +56,14 @@ func main() {
|
|||||||
|
|
||||||
err = reportTemplate.Execute(f, struct {
|
err = reportTemplate.Execute(f, struct {
|
||||||
Timestamp time.Time
|
Timestamp time.Time
|
||||||
Topics []string
|
ColNames []string
|
||||||
Results []float64
|
Results []float64
|
||||||
Columns []string
|
ColAlign []string
|
||||||
}{
|
}{
|
||||||
Timestamp: time.Now(),
|
Timestamp: time.Now(),
|
||||||
Topics: topics,
|
ColNames: colNames,
|
||||||
Results: results,
|
Results: results,
|
||||||
Columns: columns,
|
ColAlign: colAlign,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
% This file is a part of the math-optim project.
|
% This file is a part of the math-optim project.
|
||||||
% project homepage: https://git.dotya.ml/wanderer/math-optim/
|
% project homepage: https://git.dotya.ml/wanderer/math-optim/
|
||||||
|
|
||||||
\begin{tabular}{ ||{{- range $i, $v := .Columns }}{{$v}}| {{- end}}| }
|
\begin{tabular}{ ||{{- range $i, $v := .ColAlign }}{{$v}}| {{- end}}| }
|
||||||
{{ range $i, $v := .Topics }}{{$v }} & {{ end}}\\
|
{{ range $i, $v := .ColNames }}{{$v }} & {{ end}}\\
|
||||||
{{- range .Results }}
|
{{- range .Results }}
|
||||||
{{ printf "%f &" . }} \\
|
{{ printf "%f &" . }} \\
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
Loading…
Reference in New Issue
Block a user