mirror of
https://github.com/lukewilson2002/autotrader.git
synced 2025-06-15 16:33:50 +00:00
go vet suggestion
This commit is contained in:
parent
435ce1e144
commit
9e5239c20a
16
data.go
16
data.go
@ -125,9 +125,9 @@ func (o *DataFrame) Float(column string, i int) float64 {
|
|||||||
if val == nil {
|
if val == nil {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
switch val.(type) {
|
switch val := val.(type) {
|
||||||
case float64:
|
case float64:
|
||||||
return val.(float64)
|
return val
|
||||||
default:
|
default:
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -139,9 +139,9 @@ func (o *DataFrame) Int(column string, i int) int {
|
|||||||
if val == nil {
|
if val == nil {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
switch val.(type) {
|
switch val := val.(type) {
|
||||||
case int:
|
case int:
|
||||||
return val.(int)
|
return val
|
||||||
default:
|
default:
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -153,9 +153,9 @@ func (o *DataFrame) String(column string, i int) string {
|
|||||||
if val == nil {
|
if val == nil {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
switch val.(type) {
|
switch val := val.(type) {
|
||||||
case string:
|
case string:
|
||||||
return val.(string)
|
return val
|
||||||
default:
|
default:
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
@ -167,9 +167,9 @@ func (o *DataFrame) Time(column string, i int) time.Time {
|
|||||||
if val == nil {
|
if val == nil {
|
||||||
return time.Time{}
|
return time.Time{}
|
||||||
}
|
}
|
||||||
switch val.(type) {
|
switch val := val.(type) {
|
||||||
case time.Time:
|
case time.Time:
|
||||||
return val.(time.Time)
|
return val
|
||||||
default:
|
default:
|
||||||
return time.Time{}
|
return time.Time{}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user