removed go vet warnings

master
Oliver Tonnhofer 2013-05-13 10:55:08 +02:00
parent 319927d47f
commit cba18797e9
4 changed files with 9 additions and 6 deletions

View File

@ -24,8 +24,6 @@ func Marshal(elem interface{}) ([]byte, error) {
default:
panic("invalid elem to marshal")
}
return []byte{}, nil
}
func MarshalCoord(node *element.Node) ([]byte, error) {

4
cache/db.go vendored
View File

@ -382,7 +382,7 @@ func (p *WaysCache) Iter() chan *element.Way {
it := p.db.NewIterator(ro)
defer it.Close()
it.SeekToFirst()
for it = it; it.Valid(); it.Next() {
for ; it.Valid(); it.Next() {
ways, err := binary.UnmarshalWay(it.Value())
if err != nil {
panic(err)
@ -426,7 +426,7 @@ func (p *RelationsCache) Iter() chan *element.Relation {
it := p.db.NewIterator(ro)
defer it.Close()
it.SeekToFirst()
for it = it; it.Valid(); it.Next() {
for ; it.Valid(); it.Next() {
relation, err := binary.UnmarshalRelation(it.Value())
if err != nil {
panic(err)

View File

@ -238,7 +238,12 @@ func main() {
waitFill := sync.WaitGroup{}
wayChan := make(chan []element.Way)
waitDb := &sync.WaitGroup{}
config := db.Config{"postgres", *connection, 3857, "public"}
config := db.Config{
Type: "postgres",
ConnectionParams: *connection,
Srid: 3857,
Schema: "public",
}
pg, err := db.Open(config)
if err != nil {
log.Fatal(err)

View File

@ -104,8 +104,8 @@ func ParseDenseNodeTags(stringtable StringTable, keysVals *[]int32, pos *int) ma
*pos += 1
result[stringtable[key]] = stringtable[val]
}
return result
}
func ParseTags(stringtable StringTable, keys []uint32, vals []uint32) map[string]string {
tags := make(map[string]string)
for i := 0; i < len(keys); i++ {