Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
nrwiersma committed Feb 27, 2019
1 parent 6774649 commit a75ec18
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions container/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a75ec18

Please sign in to comment.