Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

doc/golint cleanup

  • Loading branch information...
commit e19171c17beb110cac96d5821726d2bbacf42221 1 parent 98eaf35
@dustin dustin authored
Showing with 5 additions and 7 deletions.
  1. +4 −4 util.go
  2. +1 −3 vbmap.go
View
8 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 == "" {
View
4 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++ {
Please sign in to comment.
Something went wrong with that request. Please try again.