Skip to content

Commit

Permalink
doc/golint cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dustin committed Feb 4, 2014
1 parent 98eaf35 commit e19171c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 4 additions & 4 deletions util.go
Expand Up @@ -6,15 +6,16 @@ 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)]
}
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 {
Expand All @@ -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 == "" {
Expand Down
4 changes: 1 addition & 3 deletions vbmap.go
@@ -1,7 +1,5 @@
package couchbase

import ()

var crc32tab = []uint32{
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba,
0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
Expand Down Expand Up @@ -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++ {
Expand Down

0 comments on commit e19171c

Please sign in to comment.