package webp import ( "image" "io" ) // SetEncoderForTest replaces the encoder Variant uses and returns the // restore function (tests only). func SetEncoderForTest(fn func(io.Writer, image.Image) error) func() { encodeImage = fn return func() { encodeImage = Encode } }