# HG changeset patch # User Sascha L. Teichmann # Date 1550052786 -3600 # Node ID 97bba8b51b9c15ee70adcf0e2eeb15acdd2e5b37 # Parent 4374d942b23db79699100fdd8814c012aed8723b Stretch import: Be more verbose about range before inserting data. diff -r 4374d942b23d -r 97bba8b51b9c pkg/imports/st.go --- a/pkg/imports/st.go Wed Feb 13 10:52:14 2019 +0100 +++ b/pkg/imports/st.go Wed Feb 13 11:13:06 2019 +0100 @@ -170,6 +170,8 @@ nobjnm = sql.NullString{String: *st.NObjNam, Valid: true} } + feedback.Info("Stretch from %s to %s.", st.From, st.To) + var id int64 if err := tx.QueryRowContext( ctx, @@ -194,6 +196,8 @@ } // store the associated countries. + + feedback.Info("Countries associated with stretch: %s.", st.Countries) for _, c := range st.Countries { if _, err := insertCountryStmt.ExecContext(ctx, id, c); err != nil { return nil, err diff -r 4374d942b23d -r 97bba8b51b9c pkg/models/common.go --- a/pkg/models/common.go Wed Feb 13 10:52:14 2019 +0100 +++ b/pkg/models/common.go Wed Feb 13 11:13:06 2019 +0100 @@ -128,3 +128,14 @@ *uc = countries return nil } + +func (uc UniqueCountries) String() string { + var b strings.Builder + for i, c := range uc { + if i > 0 { + b.WriteString(", ") + } + b.WriteString(string(c)) + } + return b.String() +}