Skip to content

Commit

Permalink
chore: fix formatting (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
nrwiersma authored May 28, 2023
1 parent 22ee50e commit 0985444
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 23 deletions.
8 changes: 3 additions & 5 deletions doc.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
Package avro implements encoding and decoding of Avro as defined by the Avro specification.
See the Avro specification for an understanding of Avro: http://avro.apache.org/docs/current/
*/
// Package avro implements encoding and decoding of Avro as defined by the Avro specification.
//
// See the Avro specification for an understanding of Avro: http://avro.apache.org/docs/current/
package avro
8 changes: 6 additions & 2 deletions gen/gen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package gen_test
import (
"bytes"
"flag"
"go/format"
"os"
"regexp"
"strings"
Expand Down Expand Up @@ -149,14 +150,17 @@ func TestGenerator(t *testing.T) {
err = g.Write(&buf)
require.NoError(t, err)

formatted, err := format.Source(buf.Bytes())
require.NoError(t, err)

if *update {
err = os.WriteFile("testdata/golden_multiple.go", buf.Bytes(), 0600)
err = os.WriteFile("testdata/golden_multiple.go", formatted, 0600)
require.NoError(t, err)
}

want, err := os.ReadFile("testdata/golden_multiple.go")
require.NoError(t, err)
assert.Equal(t, want, buf.Bytes())
assert.Equal(t, string(want), string(formatted))
}

// generate is a utility to run the generation and return the result as a tuple
Expand Down
7 changes: 3 additions & 4 deletions gen/testdata/golden_multiple.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions ocf/ocf.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/*
Package ocf implements encoding and decoding of Avro Object Container Files as defined by the Avro specification.
See the Avro specification for an understanding of Avro: http://avro.apache.org/docs/current/
*/
// Package ocf implements encoding and decoding of Avro Object Container Files as defined by the Avro specification.
//
// See the Avro specification for an understanding of Avro: http://avro.apache.org/docs/current/
package ocf

import (
Expand Down
10 changes: 4 additions & 6 deletions registry/client.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
/*
Package registry implements a Confluent Schema Registry compliant client.
See the Confluent Schema Registry docs for an understanding of the
API: https://docs.confluent.io/current/schema-registry/docs/api.html
*/
// Package registry implements a Confluent Schema Registry compliant client.
//
// See the Confluent Schema Registry docs for an understanding of the
// API: https://docs.confluent.io/current/schema-registry/docs/api.html
package registry

import (
Expand Down
2 changes: 1 addition & 1 deletion writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func TestWriter_FlushShortWrite(t *testing.T) {
_, _ = w.Write([]byte("test"))

err := w.Flush()

require.ErrorIs(t, err, io.ErrShortWrite)
}

Expand Down

0 comments on commit 0985444

Please sign in to comment.