From e19171c17beb110cac96d5821726d2bbacf42221 Mon Sep 17 00:00:00 2001 From: Dustin Sallings Date: Tue, 4 Feb 2014 01:29:14 -0800 Subject: [PATCH] doc/golint cleanup --- util.go | 8 ++++---- vbmap.go | 4 +--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/util.go b/util.go index 2fb5db2..4d286a3 100644 --- a/util.go +++ b/util.go @@ -6,7 +6,7 @@ import ( "strings" ) -// Return the hostname with the given suffix removed. +// CleanupHost returns the hostname with the given suffix removed. func CleanupHost(h, commonSuffix string) string { if strings.HasSuffix(h, commonSuffix) { return h[:len(h)-len(commonSuffix)] @@ -14,7 +14,8 @@ func CleanupHost(h, commonSuffix string) string { return h } -// Find the longest common suffix from the given strings. +// FindCommonSuffix returns the longest common suffix from the given +// strings. func FindCommonSuffix(input []string) string { rv := "" if len(input) < 2 { @@ -37,8 +38,7 @@ func FindCommonSuffix(input []string) string { return rv } -// Some sanity-checking around URL.Parse, which is woefully trusting of bogus URL strings -// like "" or "foo bar". +// ParseURL is a wrapper around url.Parse with some sanity-checking func ParseURL(urlStr string) (result *url.URL, err error) { result, err = url.Parse(urlStr) if result != nil && result.Scheme == "" { diff --git a/vbmap.go b/vbmap.go index 3333bd4..b96a18e 100644 --- a/vbmap.go +++ b/vbmap.go @@ -1,7 +1,5 @@ package couchbase -import () - var crc32tab = []uint32{ 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, @@ -68,7 +66,7 @@ var crc32tab = []uint32{ 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d} -// Get the vbucket for the given key. +// VBHash finds the vbucket for the given key. func (b *Bucket) VBHash(key string) uint32 { crc := uint32(0xffffffff) for x := 0; x < len(key); x++ {