timetable-mgr/corpus/stations.go
Fred Boniface 3883031e04
All checks were successful
Go Test / test (push) Successful in 1m4s
Increase use of pointers in CORPUS package
2024-04-10 20:56:13 +01:00

24 lines
620 B
Go

package corpus
import "git.fjla.uk/owlboard/go-types/pkg/database"
// Removes non-station entities from the CORPUS Data, ready for insertion to the database (stations collection)
func createStationEntries(corpusData *[]database.CorpusEntry) *[]database.StationEntry {
var stationEntries []database.StationEntry
for _, entry := range *corpusData {
if entry.CRS != "" {
stationEntry := database.StationEntry{
CRS: entry.CRS,
TIPLOC: entry.TIPLOC,
NLCDESC: entry.NLCDESC,
STANOX: entry.STANOX,
}
stationEntries = append(stationEntries, stationEntry)
}
}
return &stationEntries
}