Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
yokofly committed Oct 24, 2024
1 parent 5ff4943 commit 5e475ae
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/dbio/database/database_proton.go
Original file line number Diff line number Diff line change
Expand Up @@ -1146,10 +1146,12 @@ func (conn *ProtonConn) convertToArrayFloat32(value interface{}) ([]float32, err
}
func (conn *ProtonConn) convertToArrayFloat64(value interface{}) ([]float64, error) {
if value == nil {
return nil, nil
g.Info("empty arrayfloat64 if value == nil")
return []float64{}, nil
}

if value == "" {
g.Info("empty arrayfloat64 if value == \"\"")
return []float64{}, nil
}

Expand All @@ -1158,6 +1160,11 @@ func (conn *ProtonConn) convertToArrayFloat64(value interface{}) ([]float64, err
return nil, fmt.Errorf("expected string, got %T", value)
}

if len(str) == 0 {
g.Info("empty arrayfloat64 if len(str) == 0")
return []float64{}, nil
}

var result []float64
err := json.Unmarshal([]byte(str), &result)
if err != nil {
Expand Down

0 comments on commit 5e475ae

Please sign in to comment.