Fixed mtr new csv format
This commit is contained in:
@@ -87,7 +87,7 @@ func ( this QueryResult ) Message() ( string, error ) {
|
||||
|
||||
for _, d := range keys {
|
||||
b := st[ d ]
|
||||
sb.WriteString( q.Key )
|
||||
utils.WriteMDv2Text( &sb, q.Key )
|
||||
|
||||
if d == "O" {
|
||||
sb.WriteString( "↑" )
|
||||
|
@@ -7,7 +7,6 @@ import (
|
||||
"net/http"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
query "github.com/tgckpg/golifehk/query"
|
||||
"github.com/tgckpg/golifehk/utils"
|
||||
@@ -30,7 +29,6 @@ func readBusStopData( r io.Reader ) ( *map[string] *BusStop, error ) {
|
||||
for i, line := range entries {
|
||||
if i == 0 {
|
||||
headers = line
|
||||
line[0] = strings.TrimLeft( line[0], utils.BOM )
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -43,8 +41,8 @@ func readBusStopData( r io.Reader ) ( *map[string] *BusStop, error ) {
|
||||
case "DIRECTION":
|
||||
entry.Direction = value
|
||||
case "STATION_SEQNO":
|
||||
v, _ := strconv.Atoi( value )
|
||||
entry.StationSeq = v
|
||||
v, _ := strconv.ParseFloat( value, 64 )
|
||||
entry.StationSeq = int( v )
|
||||
case "STATION_ID":
|
||||
entry.StationId = value
|
||||
case "STATION_LATITUDE":
|
||||
@@ -106,6 +104,7 @@ func getBusStops() (*[] query.ISearchable, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
utils.ReadBOM( buff )
|
||||
busStopMap, err := readBusStopData( buff )
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user