From a75ec186a7cc12fdd75fa65ca7fe87e33c32acfc Mon Sep 17 00:00:00 2001 From: Nicholas Wiersma Date: Wed, 27 Feb 2019 18:46:47 +0200 Subject: [PATCH] Fix linting --- container/container.go | 4 ++++ schema.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/container/container.go b/container/container.go index d2aa2bf7..279e53a7 100644 --- a/container/container.go +++ b/container/container.go @@ -119,6 +119,7 @@ func (d *Decoder) readBlock() (int64, error) { return count, d.reader.Error } +// Encoder writes Avro container file to an output stream. type Encoder struct { writer *avro.Writer buf *bytes.Buffer @@ -129,6 +130,7 @@ type Encoder struct { count int } +// NewEncoder returns a new encoder that writes to w using schema s. func NewEncoder(s string, w io.Writer) (*Encoder, error) { schema, err := avro.Parse(s) if err != nil { @@ -164,6 +166,7 @@ func NewEncoder(s string, w io.Writer) (*Encoder, error) { }, nil } +// Encode writes the Avro encoding of v to the stream. func (e *Encoder) Encode(v interface{}) error { if err := e.encoder.Encode(v); err != nil { return err @@ -179,6 +182,7 @@ func (e *Encoder) Encode(v interface{}) error { return e.writer.Error } +// Close closes the encoder, flushing the writer. func (e *Encoder) Close() error { if e.count == 0 { return nil diff --git a/schema.go b/schema.go index 18d8080e..c1daf8b3 100644 --- a/schema.go +++ b/schema.go @@ -53,7 +53,7 @@ var schemaConfig = frozenSchemaConfig{} // Schemas is a slice of Schemas. type Schemas []Schema -// getSchemaFromCache gets a schema and position by type or name if it is a named schema. +// Get gets a schema and position by type or name if it is a named schema. func (s Schemas) Get(name string) (Schema, int) { for i, schema := range s { if string(schema.Type()) == name {