From 4b09a4f60a00d1d0f904cdbdbd1a257452260227 Mon Sep 17 00:00:00 2001 From: saxon Date: Thu, 10 Jan 2019 17:31:14 +1030 Subject: [PATCH] psi: trim() => trimTo() --- stream/mts/psi/helpers.go | 2 +- stream/mts/psi/psi_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stream/mts/psi/helpers.go b/stream/mts/psi/helpers.go index 15029e36..f49754ed 100644 --- a/stream/mts/psi/helpers.go +++ b/stream/mts/psi/helpers.go @@ -113,7 +113,7 @@ func UpdateLocation(d []byte, s string) error { return nil } -func trim(d []byte, t byte) []byte { +func trimTo(d []byte, t byte) []byte { for i, b := range d { if b == t { return d[:i] diff --git a/stream/mts/psi/psi_test.go b/stream/mts/psi/psi_test.go index d3380d9a..0397bc33 100644 --- a/stream/mts/psi/psi_test.go +++ b/stream/mts/psi/psi_test.go @@ -358,7 +358,7 @@ func TestLocationUpdate(t *testing.T) { func TestTrim(t *testing.T) { test := []byte{0xa3, 0x01, 0x03, 0x00, 0xde} want := []byte{0xa3, 0x01, 0x03} - got := trim(test, 0x00) + got := trimTo(test, 0x00) if !bytes.Equal(got, want) { t.Errorf(errCmp, "TestTrim", want, got) }