func CheckForNaN(data interface{}, setTo float64) {
	v := reflect.ValueOf(data).Elem()
	for i := 0; i < v.NumField(); i++ {
		field := v.Field(i)
		if field.Kind() == reflect.Float64 && math.IsNaN(field.Float()) {
			v.Field(i).SetFloat(setTo)
		}
	}
}
CheckForNaN walks through the given interface and set any float64 value that
are NaN to the value of setTo.
package math
import (
	"math"
	"reflect"
)