Skip to content

Commit

Permalink
Merge pull request #338 from dvrkps/master
Browse files Browse the repository at this point in the history
Clean go vet error and ineffassign warnings.
  • Loading branch information
taowen authored Jan 14, 2019
2 parents 2d42ff7 + 3a023a5 commit f64ce68
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func ExampleGet() {
// Crimson
}

func ExampleMapKey() {
func ExampleMyKey() {
hello := MyKey("hello")
output, _ := Marshal(map[*MyKey]string{&hello: "world"})
fmt.Println(string(output))
Expand Down
12 changes: 4 additions & 8 deletions iter_float.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,12 @@ func (iter *Iterator) ReadFloat32() (ret float32) {
}

func (iter *Iterator) readPositiveFloat32() (ret float32) {
value := uint64(0)
c := byte(' ')
i := iter.head
// first char
if i == iter.tail {
return iter.readFloat32SlowPath()
}
c = iter.buf[i]
c := iter.buf[i]
i++
ind := floatDigits[c]
switch ind {
Expand All @@ -107,7 +105,7 @@ func (iter *Iterator) readPositiveFloat32() (ret float32) {
return
}
}
value = uint64(ind)
value := uint64(ind)
// chars before dot
non_decimal_loop:
for ; i < iter.tail; i++ {
Expand Down Expand Up @@ -216,14 +214,12 @@ func (iter *Iterator) ReadFloat64() (ret float64) {
}

func (iter *Iterator) readPositiveFloat64() (ret float64) {
value := uint64(0)
c := byte(' ')
i := iter.head
// first char
if i == iter.tail {
return iter.readFloat64SlowPath()
}
c = iter.buf[i]
c := iter.buf[i]
i++
ind := floatDigits[c]
switch ind {
Expand All @@ -246,7 +242,7 @@ func (iter *Iterator) readPositiveFloat64() (ret float64) {
return
}
}
value = uint64(ind)
value := uint64(ind)
// chars before dot
non_decimal_loop:
for ; i < iter.tail; i++ {
Expand Down

0 comments on commit f64ce68

Please sign in to comment.