Mercurial > gemma
comparison pkg/imports/dsr.go @ 4852:046a07a33b19
Fixed the golint issues of the imports package.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Tue, 19 Nov 2019 16:08:55 +0100 |
parents | 4847ac70103a |
children | 427f87ac96d6 |
comparison
equal
deleted
inserted
replaced
4851:faabfed7f0e9 | 4852:046a07a33b19 |
---|---|
22 "gemma.intevation.de/gemma/pkg/models" | 22 "gemma.intevation.de/gemma/pkg/models" |
23 ) | 23 ) |
24 | 24 |
25 // DeleteSoundingResult is a Job to delete a sounding result from the database. | 25 // DeleteSoundingResult is a Job to delete a sounding result from the database. |
26 type DeleteSoundingResult struct { | 26 type DeleteSoundingResult struct { |
27 BottleneckId string `json:"bottleneck-id"` | 27 BottleneckID string `json:"bottleneck-id"` |
28 Date models.Date `json:"date-info"` | 28 Date models.Date `json:"date-info"` |
29 } | 29 } |
30 | 30 |
31 // Description gives a short info about relevant facts of this import. | |
31 func (dsr *DeleteSoundingResult) Description() (string, error) { | 32 func (dsr *DeleteSoundingResult) Description() (string, error) { |
32 return dsr.BottleneckId + "|" + dsr.Date.Format(common.DateFormat), nil | 33 return dsr.BottleneckID + "|" + dsr.Date.Format(common.DateFormat), nil |
33 } | 34 } |
34 | 35 |
35 // DSRJobKind is the import queue type identifier. | 36 // DSRJobKind is the import queue type identifier. |
36 const DSRJobKind JobKind = "dsr" | 37 const DSRJobKind JobKind = "dsr" |
37 | 38 |
104 return nil, err | 105 return nil, err |
105 } | 106 } |
106 defer tx.Rollback() | 107 defer tx.Rollback() |
107 | 108 |
108 feedback.Info("SR: bottleneck-id: %v, date-info: %v", | 109 feedback.Info("SR: bottleneck-id: %v, date-info: %v", |
109 dsr.BottleneckId, dsr.Date.Time) | 110 dsr.BottleneckID, dsr.Date.Time) |
110 | 111 |
111 var id int64 | 112 var id int64 |
112 if err := tx.QueryRowContext(ctx, dsrFindSQL, | 113 if err := tx.QueryRowContext(ctx, dsrFindSQL, |
113 dsr.BottleneckId, dsr.Date.Time).Scan(&id); err != nil { | 114 dsr.BottleneckID, dsr.Date.Time).Scan(&id); err != nil { |
114 return nil, err | 115 return nil, err |
115 } | 116 } |
116 | 117 |
117 feedback.Info("Prepare deletion of sounding result with id %d", id) | 118 feedback.Info("Prepare deletion of sounding result with id %d", id) |
118 | 119 |