diff --git a/pkg/content/content.go b/pkg/content/content.go index 92b612a3..f544c57f 100644 --- a/pkg/content/content.go +++ b/pkg/content/content.go @@ -162,36 +162,37 @@ func (content *Content) Abort(ctx context.Context, ref string) error { func (content *Content) Writer(ctx context.Context, opts ...content.WriterOpt) (content.Writer, error) { writer, err := content.store.Writer(ctx, opts...) - return &LocalWriter{ + return &localWriter{ writer: writer, }, err } -type LocalWriter struct { +// localWriter wrap the content.Writer +type localWriter struct { writer content.Writer } -func (localWriter *LocalWriter) Close() error { +func (localWriter *localWriter) Close() error { return localWriter.writer.Close() } -func (localWriter *LocalWriter) Write(p []byte) (int, error) { +func (localWriter *localWriter) Write(p []byte) (int, error) { return localWriter.writer.Write(p) } -func (localWriter *LocalWriter) Digest() digest.Digest { +func (localWriter *localWriter) Digest() digest.Digest { return localWriter.writer.Digest() } -func (localWriter *LocalWriter) Truncate(size int64) error { +func (localWriter *localWriter) Truncate(size int64) error { return localWriter.writer.Truncate(size) } -func (localWriter *LocalWriter) Commit(ctx context.Context, size int64, expected digest.Digest, opts ...content.Opt) error { +func (localWriter *localWriter) Commit(ctx context.Context, size int64, expected digest.Digest, opts ...content.Opt) error { // we don't write any lables, drop the opts return localWriter.writer.Commit(ctx, size, expected) } -func (localWriter *LocalWriter) Status() (st content.Status, err error) { +func (localWriter *localWriter) Status() (st content.Status, err error) { return localWriter.writer.Status() }