Skip to content

Commit

Permalink
cmd/structer: fix csv codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
rjeczalik committed May 29, 2017
1 parent 7b997aa commit 57e06fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/structer/csv.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func ({{$r}} *{{$v.StructName}}) MarshalCSV() ([]string, error) {
strconv.FormatBool({{$r}}.{{$s.Name}}),{{else if (eq $s.Type.Name "int64")}}
strconv.FormatInt({{$r}}.{{$s.Name}}, 10),{{else if (eq $s.Type.Name "float64")}}
strconv.FormatFloat({{$r}}.{{$s.Name}}, 'f', -1, 64),{{else if (eq $s.Type.Name "time.Time")}}
time.Parse("{{$v.TimeFormat}}", {{$r}}.{{$s.Name}}),{{else}}
{{$r}}.{{$s.Name}}.Format("{{$v.TimeFormat}}"),{{else}}
fmt.Sprintf("%v", {{$r}}.{{$s.Name}}),{{end}}{{end}}
}
return records, nil
Expand Down

0 comments on commit 57e06fa

Please # to comment.