(value string)
| 5 | ) |
| 6 | |
| 7 | func parseValue(value string) interface{} { |
| 8 | if intVal, err := strconv.ParseInt(value, 10, 64); err == nil { |
| 9 | return intVal |
| 10 | } |
| 11 | |
| 12 | if floatVal, err := strconv.ParseFloat(value, 64); err == nil { |
| 13 | return floatVal |
| 14 | } |
| 15 | |
| 16 | if value == "true" { |
| 17 | return true |
| 18 | } |
| 19 | if value == "false" { |
| 20 | return false |
| 21 | } |
| 22 | |
| 23 | if timeVal, err := ParseDateTime(value); err == nil { |
| 24 | return TimestampValue{ |
| 25 | Time: timeVal, |
| 26 | Original: value, |
| 27 | Precision: getDatePrecisionFromString(value), |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | return value |
| 32 | } |
no test coverage detected