func annotatedTeeReadCloser(r io.Reader, w io.Writer) *teeReader {
	return &teeReader{r, w}
}
annotatedTeeReadCloser is a copy of io.TeeReader that implements
parser.AnnotatedReadCloser. It returns a Reader that writes to w what it
reads from r. All reads from r performed through it are matched with
corresponding writes to w. There is no internal buffering - the write must
complete before the read completes. Any error encountered while writing is
reported as a read error. If the underlying reader is a
parser.AnnotatedReadCloser the tee reader will invoke its Annotate function.
Otherwise it will return nil. Closing is always a no-op.
package xpkg
import (
	"archive/tar"
	"bytes"
	"context"
	"io"
	"github.com/crossplane/crossplane-runtime/pkg/parser"
	pkgmetav1 "github.com/crossplane/crossplane/apis/pkg/meta/v1"
	v1 "github.com/google/go-containerregistry/pkg/v1"
	"github.com/google/go-containerregistry/pkg/v1/empty"
	"github.com/google/go-containerregistry/pkg/v1/mutate"
	"github.com/google/go-containerregistry/pkg/v1/tarball"
	"github.com/pkg/errors"
	"k8s.io/apimachinery/pkg/runtime"
)
const (
	errParserPackage = "failed to parse package"
	errLintPackage   = "failed to lint package"
	errInitBackend   = "failed to initialize package parsing backend"
	errTarFromStream = "failed to build tarball from package stream"
	errLayerFromTar  = "failed to convert tarball to image layer"
	errBuildImage    = "failed to build image from layers"
)