chore: format our golang codes by 'goreturns -l -w .' (#47)
be noted that we don't need to format generated codes, e.g. generated by thrift
This commit is contained in:
parent
a247e34ea4
commit
927eb455ef
@ -1,8 +1,8 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func setChan2True(c chan<- bool) {
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"os"
|
||||
"log"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"io"
|
||||
"encoding/csv"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"strings"
|
||||
"log"
|
||||
"os"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/Telenav/osrm-backend/traffic_updater/go/gen-go/proxy"
|
||||
)
|
||||
@ -51,7 +51,6 @@ func TestGenerateSingleRecord2(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func validateStatistic(ds *dumperStatistic, t *testing.T) {
|
||||
sum := ds.Sum()
|
||||
if (sum.wayCnt != 4) || (sum.nodeCnt != 9) || (sum.fwdRecordCnt != 4) || (sum.bwdRecordCnt != 3) || (sum.wayMatchedCnt != 4) || (sum.nodeMatchedCnt != 9) {
|
||||
@ -177,4 +176,3 @@ func compareFileContentUnstable(f1, f2 string, t *testing.T) {
|
||||
t.Error("TestLoadWay2Nodeids failed to generate correct map\n")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/golang/snappy"
|
||||
)
|
||||
|
||||
@ -38,7 +39,6 @@ func load(mappingPath string, data chan<- string) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// input data format
|
||||
// wayid1, n1, n2
|
||||
// wayid2, n3, n4, n5
|
||||
@ -54,5 +54,3 @@ func convert(data <-chan string, sources [TASKNUM]chan string) {
|
||||
sources[chanIndex] <- str
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,12 +1,11 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"reflect"
|
||||
"sync"
|
||||
"testing"
|
||||
)
|
||||
|
||||
|
||||
func TestLoadWay2Nodeids(t *testing.T) {
|
||||
// load result into sources
|
||||
var sources [TASKNUM]chan string
|
||||
@ -61,4 +60,3 @@ func generateMockWay2nodeids(way2nodeids map[string]bool) {
|
||||
way2nodeids["24418343,84760849102,84760850102"] = true
|
||||
way2nodeids["24418344,84760846102,84760858102"] = true
|
||||
}
|
||||
|
||||
|
||||
@ -2,10 +2,11 @@ package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"strings"
|
||||
"fmt"
|
||||
"os"
|
||||
"io"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/golang/snappy"
|
||||
)
|
||||
|
||||
|
||||
@ -156,4 +156,3 @@ func main() {
|
||||
endTime := time.Now()
|
||||
fmt.Printf("Total processing time for wayid2nodeids-extract takes %f seconds\n", endTime.Sub(startTime).Seconds())
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user