From 1baf9f9dee31729eaac4b168d55c673d3aa987a1 Mon Sep 17 00:00:00 2001 From: "Sascha L. Teichmann" Date: Wed, 27 May 2015 18:13:39 +0200 Subject: [PATCH] Silence a few golint warnings. --- common/coords.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/common/coords.go b/common/coords.go index c4b20b6..25af789 100644 --- a/common/coords.go +++ b/common/coords.go @@ -90,7 +90,7 @@ func MaxCoord(a, b Coord) Coord { Z: maxComponent(a.Z, b.Z)} } -// Constructs a database key out of byte slice. +// DecodeStringFromBytes constructs a database key out of byte slice. func DecodeStringFromBytes(key []byte) (pos int64, err error) { return strconv.ParseInt(string(key), 10, 64) } @@ -99,7 +99,7 @@ func StringToBytes(key int64) []byte { return []byte(strconv.FormatInt(key, 10)) } -// Encode a block pos to byte slice. +// EncodeStringToBytes encodes a block pos to byte slice. func EncodeStringToBytes(key int64) ([]byte, error) { return StringToBytes(key), nil } @@ -230,22 +230,22 @@ func IdentityTranscoder(key []byte) ([]byte, error) { } func TranscodePlainToInterleaved(key []byte) ([]byte, error) { - if pos, err := DecodeStringFromBytesToInterleaved(key); err != nil { + pos, err := DecodeStringFromBytesToInterleaved(key) + if err != nil { return nil, err - } else { - return EncodeToBigEndian(pos) } + return EncodeToBigEndian(pos) } func TranscodeInterleavedToPlain(key []byte) ([]byte, error) { - if pos, err := DecodeFromBigEndian(key); err != nil { + pos, err := DecodeFromBigEndian(key) + if err != nil { return nil, err - } else { - return EncodeStringToBytes(TransformInterleavedToPlain(pos)) } + return EncodeStringToBytes(TransformInterleavedToPlain(pos)) } -// For correctness checks only. +// NaiveBigMin is for correctness checks of BigMin only. func NaiveBigMin(minz, maxz, zcode int64) int64 { var ( c1 = InterleavedToCoord(minz)