diff --git a/order_test.go b/order_test.go index d487818..caf8802 100644 --- a/order_test.go +++ b/order_test.go @@ -19,14 +19,14 @@ func TestOrder(t *testing.T) { f, err := os.Open(cfg.LockFilePath()) assert.NoError(t, err) - current, err := protolockFromReader(f) + current, err := FromReader(f) assert.NoError(t, err) r, err := Commit(*cfg) assert.NoError(t, err) assert.NotNil(t, r) - updated, err := protolockFromReader(r) + updated, err := FromReader(r) assert.NoError(t, err) assert.Equal(t, current, updated) diff --git a/parse.go b/parse.go index da9fb74..c9dc0ea 100644 --- a/parse.go +++ b/parse.go @@ -436,8 +436,8 @@ func openLockFile(cfg Config) (io.ReadCloser, error) { return f, nil } -// protolockFromReader unmarshals a proto.lock file into a Protolock struct. -func protolockFromReader(r io.Reader) (Protolock, error) { +// FromReader unmarshals a proto.lock file into a Protolock struct. +func FromReader(r io.Reader) (Protolock, error) { buf := bytes.Buffer{} _, err := io.Copy(&buf, r) if err != nil { @@ -453,10 +453,10 @@ func protolockFromReader(r io.Reader) (Protolock, error) { return lock, nil } -// compare returns a Report struct and an error which indicates that there is +// Compare returns a Report struct and an error which indicates that there is // one or more warnings to report to the caller. If no error is returned, the // Report can be ignored. -func compare(current, update Protolock) (*Report, error) { +func Compare(current, update Protolock) (*Report, error) { var warnings []Warning var wg sync.WaitGroup report := &Report{ diff --git a/parse_test.go b/parse_test.go index 64547f8..f6a4319 100644 --- a/parse_test.go +++ b/parse_test.go @@ -311,7 +311,7 @@ func TestParseWithEntryOptions(t *testing.T) { assert.NoError(t, err) assert.Len(t, entry.Options, 3) - assert.Equal(t, "java_multiple_files", entry.Options[0].Name, ) + assert.Equal(t, "java_multiple_files", entry.Options[0].Name) assert.Equal(t, "true", entry.Options[0].Value) assert.Equal(t, "java_package", entry.Options[1].Name) assert.Equal(t, "test.java.package", entry.Options[1].Value) diff --git a/status.go b/status.go index 3da2ff5..ca1be99 100644 --- a/status.go +++ b/status.go @@ -23,10 +23,10 @@ func Status(cfg Config) (*Report, error) { } defer lockFile.Close() - current, err := protolockFromReader(lockFile) + current, err := FromReader(lockFile) if err != nil { return nil, err } - return compare(current, *updated) + return Compare(current, *updated) }