Ver Fonte

Removed pingo.Address.Last

arianagiroux há 1 mês atrás
pai
commit
a50c60b3d3
2 ficheiros alterados com 0 adições e 16 exclusões
  1. 0 9
      ping.go
  2. 0 7
      ping_test.go

+ 0 - 9
ping.go

@@ -131,12 +131,3 @@ func (a Address) Poll() (results []float64, err error) {
 	a.Results = a.Truncate() // enforce max length
 	return a.Results, err
 }
-
-// Last returns the last result in Address.Results. Returns -1 if no previous result
-func (a Address) Last() (delay float64) {
-	if len(a.Results) > 0 {
-		return a.Results[len(a.Results)-1]
-	} else {
-		return -1
-	}
-}

+ 0 - 7
ping_test.go

@@ -108,10 +108,3 @@ func Test_Address_Truncate(t *testing.T) {
 	postTruncate := testA.Truncate()
 	assert.True(t, len(postTruncate) == 10)
 }
-
-func Test_Address_Last(t *testing.T) {
-	testA := spawnAddress("test", []float64{20}, 10)
-	assert.True(t, testA.Last() == 20)
-	testA = spawnAddress("test", []float64{}, 10)
-	assert.True(t, testA.Last() == -1)
-}