Prechádzať zdrojové kódy

alter NewTraceWriter to return a pointer - go vet was complaining about passing traceWriter's mutex by value

Fred McCann 11 rokov pred
rodič
commit
8a78b623a9
5 zmenil súbory, kde vykonal 16 pridanie a 16 odobranie
  1. 2 1
      AUTHORS
  2. 1 2
      compressor.go
  3. 10 10
      policies.go
  4. 2 2
      session.go
  5. 1 1
      uuid.go

+ 2 - 1
AUTHORS

@@ -24,4 +24,5 @@ Miguel Serrano <miguelvps@gmail.com>
 Stefan Radomski <gibheer@zero-knowledge.org>
 Josh Wright <jshwright@gmail.com>
 Jacob Rhoden <jacob.rhoden@gmail.com>
-Ben Frye <benfrye@gmail.com>
+Ben Frye <benfrye@gmail.com>
+Fred McCann <fred@sharpnoodles.com>

+ 1 - 2
compressor.go

@@ -4,7 +4,6 @@ import (
 	"code.google.com/p/snappy-go/snappy"
 )
 
-
 type Compressor interface {
 	Name() string
 	Encode(data []byte) ([]byte, error)
@@ -26,4 +25,4 @@ func (s SnappyCompressor) Encode(data []byte) ([]byte, error) {
 
 func (s SnappyCompressor) Decode(data []byte) ([]byte, error) {
 	return snappy.Decode(nil, data)
-}
+}

+ 10 - 10
policies.go

@@ -1,10 +1,10 @@
-// Copyright (c) 2012 The gocql Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-//This file will be the future home for more policies
-package gocql
-
-// RetryPolicy represents the retry behavour for a query.
-type RetryPolicy struct {
-	NumRetries int //Number of times to retry a query
-}
+// Copyright (c) 2012 The gocql Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+//This file will be the future home for more policies
+package gocql
+
+// RetryPolicy represents the retry behavour for a query.
+type RetryPolicy struct {
+	NumRetries int //Number of times to retry a query
+}

+ 2 - 2
session.go

@@ -501,10 +501,10 @@ type traceWriter struct {
 // NewTraceWriter returns a simple Tracer implementation that outputs
 // the event log in a textual format.
 func NewTraceWriter(session *Session, w io.Writer) Tracer {
-	return traceWriter{session: session, w: w}
+	return &traceWriter{session: session, w: w}
 }
 
-func (t traceWriter) Trace(traceId []byte) {
+func (t *traceWriter) Trace(traceId []byte) {
 	var (
 		coordinator string
 		duration    int

+ 1 - 1
uuid.go

@@ -150,7 +150,7 @@ func (u UUID) String() string {
 	const hexString = "0123456789abcdef"
 	r := make([]byte, 36)
 	for i, b := range u {
-                r[offsets[i]] = hexString[b>>4]
+		r[offsets[i]] = hexString[b>>4]
 		r[offsets[i]+1] = hexString[b&0xF]
 	}
 	r[8] = '-'