comparison pkg/models/reproject.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 1222b777f51f
comparison
equal deleted inserted replaced
1327:cabf4789e02b 1328:d753ce6cf588
27 FromEPSG uint32 27 FromEPSG uint32
28 ToEPSG uint32 28 ToEPSG uint32
29 } 29 }
30 30
31 func NewReprojector( 31 func NewReprojector(
32 ctx context.Context,
32 conn *sql.Conn, 33 conn *sql.Conn,
33 ctx context.Context,
34 fromEPSG, toEPSG uint32, 34 fromEPSG, toEPSG uint32,
35 ) (*Reprojector, error) { 35 ) (*Reprojector, error) {
36 stmt, err := conn.PrepareContext(ctx, reprojectSQL) 36 stmt, err := conn.PrepareContext(ctx, reprojectSQL)
37 if err != nil { 37 if err != nil {
38 return nil, err 38 return nil, err
51 } 51 }
52 return nil 52 return nil
53 } 53 }
54 54
55 func (r *Reprojector) Reproject( 55 func (r *Reprojector) Reproject(
56 ctx context.Context,
56 x, y float64, 57 x, y float64,
57 ctx context.Context,
58 ) (v, w float64, err error) { 58 ) (v, w float64, err error) {
59 err = r.stmt.QueryRowContext(ctx, x, y, r.FromEPSG, r.ToEPSG).Scan(&v, &w) 59 err = r.stmt.QueryRowContext(ctx, x, y, r.FromEPSG, r.ToEPSG).Scan(&v, &w)
60 return 60 return
61 } 61 }