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() {
|
||||
columns := []string{
|
||||
// colAlign sets the alignment of latex table columns.
|
||||
colAlign := []string{
|
||||
"l",
|
||||
"c",
|
||||
"c",
|
||||
@ -30,7 +31,7 @@ func main() {
|
||||
-4.466,
|
||||
66.0008,
|
||||
}
|
||||
topics := []string{
|
||||
colNames := []string{
|
||||
"func name",
|
||||
"min",
|
||||
"max",
|
||||
@ -55,14 +56,14 @@ func main() {
|
||||
|
||||
err = reportTemplate.Execute(f, struct {
|
||||
Timestamp time.Time
|
||||
Topics []string
|
||||
ColNames []string
|
||||
Results []float64
|
||||
Columns []string
|
||||
ColAlign []string
|
||||
}{
|
||||
Timestamp: time.Now(),
|
||||
Topics: topics,
|
||||
ColNames: colNames,
|
||||
Results: results,
|
||||
Columns: columns,
|
||||
ColAlign: colAlign,
|
||||
})
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
|
@ -6,8 +6,8 @@
|
||||
% This file is a part of the math-optim project.
|
||||
% project homepage: https://git.dotya.ml/wanderer/math-optim/
|
||||
|
||||
\begin{tabular}{ ||{{- range $i, $v := .Columns }}{{$v}}| {{- end}}| }
|
||||
{{ range $i, $v := .Topics }}{{$v }} & {{ end}}\\
|
||||
\begin{tabular}{ ||{{- range $i, $v := .ColAlign }}{{$v}}| {{- end}}| }
|
||||
{{ range $i, $v := .ColNames }}{{$v }} & {{ end}}\\
|
||||
{{- range .Results }}
|
||||
{{ printf "%f &" . }} \\
|
||||
{{- end }}
|
||||
|
Loading…
Reference in New Issue
Block a user