# HG changeset patch # User Sascha L. Teichmann # Date 1547135799 -3600 # Node ID 295c82c5bc3e4f79c58f1695b2e84aacde83ce6d # Parent d3fe20a133393ce771bfe9f040ec457ee7d77d9e Fairway availability import: Cosmetics. diff -r d3fe20a13339 -r 295c82c5bc3e pkg/imports/fa.go --- a/pkg/imports/fa.go Thu Jan 10 16:43:42 2019 +0100 +++ b/pkg/imports/fa.go Thu Jan 10 16:56:39 2019 +0100 @@ -242,9 +242,8 @@ return nil, err } - latestMeasureDateRow := conn.QueryRowContext(ctx, latestMeasureDateSQL) var latestDate pgtype.Timestamp - err = latestMeasureDateRow.Scan(&latestDate) + err = conn.QueryRowContext(ctx, latestMeasureDateSQL).Scan(&latestDate) switch { case err == sql.ErrNoRows: latestDate = pgtype.Timestamp{ @@ -349,7 +348,8 @@ BottleneckId: faRes.Bottleneck_id, Surdat: faRes.SURDAT, } - if _, ok := fairwayAvailabilities[uniqueFa]; !ok { + var found bool + if faID, found = fairwayAvailabilities[uniqueFa]; !found { err = insertFAStmt.QueryRowContext( ctx, faRes.POSITION, @@ -363,8 +363,6 @@ return nil, err } fairwayAvailabilities[uniqueFa] = faID - } else { - faID, _ = fairwayAvailabilities[uniqueFa] } feedback.Info("Processing for Bottleneck %s", faRes.Bottleneck_id) faIDs = append(faIDs, faRes.Bottleneck_id)