func RoundFloat(x float64, prec int) float64 {
	frep := strconv.FormatFloat(x, 'g', prec, 64)
	f, _ := strconv.ParseFloat(frep, 64)
	return f
}
Taken from: http://play.golang.org/p/cwJj8ZJUhl
package geo
import (
	_ "database/sql"
	"fmt"
	"github.com/erikstmartin/go-testdb"
	"os"
	"strconv"
	"testing"
)
func TestPointsWithinRadiusIntegration(t *testing.T) {
	dbEnv := os.Getenv("DB")
	if dbEnv == "mock" {
		stubPointsWithinRadiusQueries()
	}
	s, sqlErr := HandleWithSQL()
	if sqlErr != nil {
		t.Error("ERROR: %s", sqlErr)
	}
	origin := &Point{37.619002, -122.37484}
	bearing := 0.0
	in_point := origin.PointAtDistanceAndBearing(7.999, bearing)
	s.sqlConn.Exec(fmt.Sprintf("INSERT INTO points(lat, lng) VALUES(%f, %f);", in_point.lat, in_point.lng))
	out_point := origin.PointAtDistanceAndBearing(8.001, bearing)
	s.sqlConn.Exec(fmt.Sprintf("INSERT INTO points(lat, lng) VALUES(%f, %f);", out_point.lat, out_point.lng))
	_, err := s.PointsWithinRadius(origin, 8)
	if err != nil {
		panic(err)
	}
	_, err2 := s.PointsWithinRadius(origin, 9)
	if err2 != nil {
		panic(err2)
	}
	FlushTestDB(s)
}
func FlushTestDB(s *SQLMapper) {
	s.sqlConn.Exec("DELETE FROM points;")
}