From f9d8accdae77de44239c7348a5225e725576496f Mon Sep 17 00:00:00 2001 From: saxon Date: Sat, 9 Feb 2019 12:14:32 +1030 Subject: [PATCH] stream/mts/meta/meta.go: Extract and ExtractAll to Get and GetAll --- stream/mts/meta/meta.go | 4 ++-- stream/mts/meta/meta_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/stream/mts/meta/meta.go b/stream/mts/meta/meta.go index a4db5da4..52e81465 100644 --- a/stream/mts/meta/meta.go +++ b/stream/mts/meta/meta.go @@ -168,7 +168,7 @@ func (m *Data) Encode() []byte { // ReadFrom extracts a value from a metadata string d, for the given key. If the // key is not present in the metadata string, an error is returned. If the // metadata header is not present in the string, an error is returned. -func Extract(key string, d []byte) (string, error) { +func Get(key string, d []byte) (string, error) { err := checkHeader(d) if err != nil { return "", err @@ -186,7 +186,7 @@ func Extract(key string, d []byte) (string, error) { // ExtractAll extracts all metadata entries from given data. An Error is returned // if the metadata does not have a valid header, or if the meta format is unexpected. -func ExtractAll(d []byte) ([][2]string, error) { +func GetAll(d []byte) ([][2]string, error) { err := checkHeader(d) if err != nil { return nil, err diff --git a/stream/mts/meta/meta_test.go b/stream/mts/meta/meta_test.go index f809b172..e5f6a4ff 100644 --- a/stream/mts/meta/meta_test.go +++ b/stream/mts/meta/meta_test.go @@ -156,7 +156,7 @@ func TestReadFrom(t *testing.T) { } for _, test := range tests { - got, err := Extract(test.key, []byte(tstMeta)) + got, err := Get(test.key, []byte(tstMeta)) if err != nil { t.Errorf("Unexpected err: %v\n", err) } @@ -180,7 +180,7 @@ func TestExtractAll(t *testing.T) { "12345", }, } - got, err := ExtractAll(tstMeta) + got, err := GetAll(tstMeta) if err != nil { t.Errorf("Unexpected error: %v\n", err) }