diff pkg/octree/tin.go @ 1328:d753ce6cf588

To make golint happier made context.Context to be the first argument in all calls.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sun, 25 Nov 2018 16:26:41 +0100
parents a244b18cb916
children 84e78d2e2d95
line wrap: on
line diff
--- a/pkg/octree/tin.go	Sun Nov 25 15:56:07 2018 +0100
+++ b/pkg/octree/tin.go	Sun Nov 25 16:26:41 2018 +0100
@@ -23,7 +23,6 @@
 	"io"
 	"log"
 	"math"
-	"time"
 )
 
 var (
@@ -199,32 +198,12 @@
 SELECT ST_AsBinary(ST_Collect(triangles.geom)) FROM triangles, trans
 WHERE ST_Covers(trans.area, triangles.poly)`
 
-	loadTinSQL     = tinSQLPrefix + `WHERE bottleneck_id = $2 AND date_info = $3` + tinSQLSuffix
 	loadTinByIDSQL = tinSQLPrefix + `WHERE id = $2` + tinSQLSuffix
 )
 
-func GenerateTin(
-	conn *sql.Conn,
+func GenerateTinByID(
 	ctx context.Context,
-	bottleneck string,
-	date time.Time,
-	epsg uint32,
-) (*Tin, error) {
-	var tin Tin
-	err := conn.QueryRowContext(ctx, loadTinSQL, epsg, bottleneck, date).Scan(&tin)
-	switch {
-	case err == sql.ErrNoRows:
-		return nil, nil
-	case err != nil:
-		return nil, err
-	}
-	tin.EPSG = epsg
-	return &tin, nil
-}
-
-func GenerateTinByID(
 	conn *sql.Conn,
-	ctx context.Context,
 	id int64,
 	epsg uint32,
 ) (*Tin, error) {