Skip to content

Commit

Permalink
refactor: remove type decl
Browse files Browse the repository at this point in the history
  • Loading branch information
ShuheiKubota committed Dec 25, 2022
1 parent d43ec35 commit 4688627
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,7 @@ func (c globalCmd) convertOne(oc outputContext, sheet string, input io.Reader) e
oc.output.DeleteSheet(sheet)
oc.output.NewSheet(sheet)

var r *csv.Reader
r = csv.NewReader(input)
r := csv.NewReader(input)
if len(c.Delimiter) > 0 {
r.Comma = []rune(c.Delimiter)[0]
}
Expand Down Expand Up @@ -393,13 +392,13 @@ func (c globalCmd) guessByColType(value string, col column) (colType, interface{
}

case typeDate:
var ptns []string = translateDatePatterns(col.InputFormat)
ptns := translateDatePatterns(col.InputFormat)
if t, ok := parseTime(value, ptns...); ok {
return typeDate, t
}

case typeTime:
var ptns []string = translateTimePatterns(col.InputFormat)
ptns := translateTimePatterns(col.InputFormat)
if t, ok := parseTime(value, ptns...); ok {
return typeTime, t
}
Expand Down

0 comments on commit 4688627

Please sign in to comment.