func Diff(ctx context.Context, dockerClient *client.Client, x, y *Snapshot) (string, error) {
	if x.DumpPath == "" || y.DumpPath == "" {
		return "", errors.New("can't diff generic snapshots")
	}
	xDump, err := getFile(ctx, dockerClient, x.ImageID, x.DumpPath)
	if err != nil {
		return "", err
	}
	yDump, err := getFile(ctx, dockerClient, y.ImageID, y.DumpPath)
	if err != nil {
		return "", err
	}
	diff := difflib.UnifiedDiff{
		A:        difflib.SplitLines(string(xDump)),
		B:        difflib.SplitLines(string(yDump)),
		FromFile: x.Title,
		ToFile:   y.Title,
		Context:  3,
	}
	return difflib.GetUnifiedDiffString(diff)
}
Diff returns the diff between the dumps of the given snapshots.
package snapshot
import (
	"archive/tar"
	"bytes"
	"context"
	"errors"
	"io"
	"path/filepath"
	"github.com/docker/docker/api/types"
	"github.com/docker/docker/api/types/container"
	"github.com/docker/docker/client"
	"github.com/pmezard/go-difflib/difflib"
)