@@ -28,7 +28,7 @@ import (
2828// from the most recent Delta.
2929// You should treat the items returned inside the deltas as immutable.
3030// This function was moved here because it is not consistent with normal list semantics, but is used in unit testing.
31- func (f * DeltaFIFO ) List () []interface {} {
31+ func (f * DeltaFIFO ) list () []interface {} {
3232 f .lock .RLock ()
3333 defer f .lock .RUnlock ()
3434 return f .listLocked ()
@@ -46,7 +46,7 @@ func (f *DeltaFIFO) listLocked() []interface{} {
4646// ListKeys returns a list of all the keys of the objects currently
4747// in the FIFO.
4848// This function was moved here because it is not consistent with normal list semantics, but is used in unit testing.
49- func (f * DeltaFIFO ) ListKeys () []string {
49+ func (f * DeltaFIFO ) listKeys () []string {
5050 f .lock .RLock ()
5151 defer f .lock .RUnlock ()
5252 list := make ([]string , 0 , len (f .queue ))
@@ -60,19 +60,19 @@ func (f *DeltaFIFO) ListKeys() []string {
6060// or sets exists=false.
6161// You should treat the items returned inside the deltas as immutable.
6262// This function was moved here because it is not consistent with normal list semantics, but is used in unit testing.
63- func (f * DeltaFIFO ) Get (obj interface {}) (item interface {}, exists bool , err error ) {
63+ func (f * DeltaFIFO ) get (obj interface {}) (item interface {}, exists bool , err error ) {
6464 key , err := f .KeyOf (obj )
6565 if err != nil {
6666 return nil , false , KeyError {obj , err }
6767 }
68- return f .GetByKey (key )
68+ return f .getByKey (key )
6969}
7070
7171// GetByKey returns the complete list of deltas for the requested item,
7272// setting exists=false if that list is empty.
7373// You should treat the items returned inside the deltas as immutable.
7474// This function was moved here because it is not consistent with normal list semantics, but is used in unit testing.
75- func (f * DeltaFIFO ) GetByKey (key string ) (item interface {}, exists bool , err error ) {
75+ func (f * DeltaFIFO ) getByKey (key string ) (item interface {}, exists bool , err error ) {
7676 f .lock .RLock ()
7777 defer f .lock .RUnlock ()
7878 d , exists := f .items [key ]
@@ -320,10 +320,10 @@ func TestDeltaFIFO_addUpdate(t *testing.T) {
320320 f .Update (mkFifoObj ("foo" , 12 ))
321321 f .Delete (mkFifoObj ("foo" , 15 ))
322322
323- if e , a := []interface {}{mkFifoObj ("foo" , 15 )}, f .List (); ! reflect .DeepEqual (e , a ) {
323+ if e , a := []interface {}{mkFifoObj ("foo" , 15 )}, f .list (); ! reflect .DeepEqual (e , a ) {
324324 t .Errorf ("Expected %+v, got %+v" , e , a )
325325 }
326- if e , a := []string {"foo" }, f .ListKeys (); ! reflect .DeepEqual (e , a ) {
326+ if e , a := []string {"foo" }, f .listKeys (); ! reflect .DeepEqual (e , a ) {
327327 t .Errorf ("Expected %+v, got %+v" , e , a )
328328 }
329329
@@ -349,7 +349,7 @@ func TestDeltaFIFO_addUpdate(t *testing.T) {
349349 t .Errorf ("Got second value %v" , unexpected .val )
350350 case <- time .After (50 * time .Millisecond ):
351351 }
352- _ , exists , _ := f .Get (mkFifoObj ("foo" , "" ))
352+ _ , exists , _ := f .get (mkFifoObj ("foo" , "" ))
353353 if exists {
354354 t .Errorf ("item did not get removed" )
355355 }
@@ -397,7 +397,7 @@ func TestDeltaFIFO_transformer(t *testing.T) {
397397 must (f .Replace ([]interface {}{}, "" ))
398398
399399 // Should be empty
400- if e , a := []string {"foo" , "bar" }, f .ListKeys (); ! reflect .DeepEqual (e , a ) {
400+ if e , a := []string {"foo" , "bar" }, f .listKeys (); ! reflect .DeepEqual (e , a ) {
401401 t .Errorf ("Expected %+v, got %+v" , e , a )
402402 }
403403
@@ -507,7 +507,7 @@ func TestDeltaFIFO_addReplace(t *testing.T) {
507507 t .Errorf ("Got second value %v" , unexpected .val )
508508 case <- time .After (50 * time .Millisecond ):
509509 }
510- _ , exists , _ := f .Get (mkFifoObj ("foo" , "" ))
510+ _ , exists , _ := f .get (mkFifoObj ("foo" , "" ))
511511 if exists {
512512 t .Errorf ("item did not get removed" )
513513 }
@@ -991,7 +991,7 @@ func BenchmarkDeltaFIFOListKeys(b *testing.B) {
991991 b .ResetTimer ()
992992 b .RunParallel (func (pb * testing.PB ) {
993993 for pb .Next () {
994- _ = f .ListKeys ()
994+ _ = f .listKeys ()
995995 }
996996 })
997997 b .StopTimer ()
0 commit comments