diff --git a/stream/mts/meta/meta.go b/stream/mts/meta/meta.go index 52e81465..29ed0a06 100644 --- a/stream/mts/meta/meta.go +++ b/stream/mts/meta/meta.go @@ -165,7 +165,7 @@ func (m *Data) Encode() []byte { return m.enc } -// ReadFrom extracts a value from a metadata string d, for the given key. If the +// ReadFrom gets 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 Get(key string, d []byte) (string, error) { @@ -184,7 +184,7 @@ func Get(key string, d []byte) (string, error) { return "", errKeyAbsent } -// ExtractAll extracts all metadata entries from given data. An Error is returned +// GetAll gets 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 GetAll(d []byte) ([][2]string, error) { err := checkHeader(d) diff --git a/stream/mts/meta/meta_test.go b/stream/mts/meta/meta_test.go index e5f6a4ff..455a829c 100644 --- a/stream/mts/meta/meta_test.go +++ b/stream/mts/meta/meta_test.go @@ -138,7 +138,7 @@ func TestEncode(t *testing.T) { // TestReadFrom checks that we can correctly obtain a value for a partiular key // from a string of metadata using the ReadFrom func. -func TestReadFrom(t *testing.T) { +func TestGetFrom(t *testing.T) { tstMeta := append([]byte{0x00, 0x10, 0x00, 0x12}, "loc=a,b,c\tts=12345"...) tests := []struct { @@ -166,9 +166,9 @@ func TestReadFrom(t *testing.T) { } } -// TestExtractAll checks that meta.ExtractAll can correctly extract all metadata +// TestGetAll checks that meta.GetAll can correctly get all metadata // from descriptor data. -func TestExtractAll(t *testing.T) { +func TestGetAll(t *testing.T) { tstMeta := append([]byte{0x00, 0x10, 0x00, 0x12}, "loc=a,b,c\tts=12345"...) want := [][2]string{ {