diff --git a/cmd/handsum/main.go b/cmd/handsum/main.go index c76ff2b3..a1344bfa 100644 --- a/cmd/handsum/main.go +++ b/cmd/handsum/main.go @@ -105,7 +105,7 @@ func encode(inFile *os.File) error { if err != nil { return err } - return handsum.Encode(os.Stdout, src) + return handsum.Encode(os.Stdout, src, nil) } func roundtrip(inFile *os.File) error { @@ -114,7 +114,7 @@ func roundtrip(inFile *os.File) error { return err } buf := &bytes.Buffer{} - err = handsum.Encode(buf, src) + err = handsum.Encode(buf, src, nil) if err != nil { return err } diff --git a/lib/handsum/handsum.go b/lib/handsum/handsum.go index cc36189d..a234d139 100644 --- a/lib/handsum/handsum.go +++ b/lib/handsum/handsum.go @@ -64,8 +64,17 @@ var ( ErrUnsupportedFileVersion = errors.New("handsum: unsupported file version") ) +// EncodeOptions are optional arguments to Encode. The zero value is valid and +// means to use the default configuration. +// +// There are no fields for now, but there may be some in the future. +type EncodeOptions struct { +} + // Encode writes src to w in the Handsum format. -func Encode(w io.Writer, src image.Image) error { +// +// options may be nil, which means to use the default configuration. +func Encode(w io.Writer, src image.Image, options *EncodeOptions) error { if (w == nil) || (src == nil) { return ErrBadArgument }