all: Format code with gofumpt

See https://github.com/mvdan/gofumpt
This commit is contained in:
Bjørn Erik Pedersen
2020-12-02 13:23:25 +01:00
parent 32471b57bd
commit d90e37e0c6
442 changed files with 1426 additions and 2254 deletions

View File

@@ -81,5 +81,4 @@ func hexStringToColor(s string) (color.Color, error) {
}
return color.RGBA{b[0], b[1], b[2], b[3]}, nil
}

View File

@@ -74,7 +74,6 @@ func TestAddColorToPalette(t *testing.T) {
c.Assert(AddColorToPalette(white, palette), qt.HasLen, 2)
c.Assert(AddColorToPalette(blue1, palette), qt.HasLen, 3)
c.Assert(AddColorToPalette(blue2, palette), qt.HasLen, 3)
}
func TestReplaceColorInPalette(t *testing.T) {

View File

@@ -77,7 +77,6 @@ func TestDecodeConfig(t *testing.T) {
imaging = imagingConfig.Cfg
c.Assert(imaging.Exif.DisableLatLong, qt.Equals, true)
c.Assert(imaging.Exif.ExcludeFields, qt.Equals, "GPS|Exif|Exposure[M|P|B]|Contrast|Resolution|Sharp|JPEG|Metering|Sensing|Saturation|ColorSpace|Flash|WhiteBalance")
}
func TestDecodeImageConfig(t *testing.T) {

View File

@@ -93,7 +93,6 @@ func compileRegexp(expression string) (*regexp.Regexp, error) {
}
return regexp.Compile(expression)
}
func NewDecoder(options ...func(*Decoder) error) (*Decoder, error) {
@@ -118,7 +117,6 @@ func (d *Decoder) Decode(r io.Reader) (ex *Exif, err error) {
x, err = _exif.Decode(r)
if err != nil {
if err.Error() == "EOF" {
// Found no Exif
return nil, nil
}
@@ -190,7 +188,6 @@ func decodeTag(x *_exif.Exif, f _exif.FieldName, t *tiff.Tag) (interface{}, erro
}
return rv, nil
}
// Code borrowed from exif.DateTime and adjusted.
@@ -202,7 +199,6 @@ func tryParseDate(x *_exif.Exif, s string) (time.Time, error) {
timeZone = tz
}
return time.ParseInLocation(exifTimeLayout, dateStr, timeZone)
}
type exifWalker struct {

View File

@@ -60,7 +60,6 @@ func TestExif(t *testing.T) {
err = json.Unmarshal(data, x2)
c.Assert(x2, eq, x)
}
func TestExifPNG(t *testing.T) {

View File

@@ -30,5 +30,4 @@ func TestFilterHash(t *testing.T) {
c.Assert(helpers.HashString(f.Grayscale()), qt.Not(qt.Equals), helpers.HashString(f.Invert()))
c.Assert(helpers.HashString(f.Gamma(32)), qt.Not(qt.Equals), helpers.HashString(f.Gamma(33)))
c.Assert(helpers.HashString(f.Gamma(32)), qt.Equals, helpers.HashString(f.Gamma(32)))
}

View File

@@ -92,7 +92,6 @@ func (i *Image) EncodeTo(conf ImageConfig, img image.Image, w io.Writer) error {
default:
return errors.New("format not supported")
}
}
// Height returns i's height.
@@ -165,7 +164,6 @@ func NewImageProcessor(cfg ImagingConfig) (*ImageProcessor, error) {
exif.ExcludeFields(e.ExcludeFields),
exif.IncludeFields(e.IncludeFields),
)
if err != nil {
return nil, err
}
@@ -174,7 +172,6 @@ func NewImageProcessor(cfg ImagingConfig) (*ImageProcessor, error) {
Cfg: cfg,
exifDecoder: exifDecoder,
}, nil
}
type ImageProcessor struct {

View File

@@ -70,5 +70,4 @@ func (p *ImageProcessor) smartCrop(img image.Image, width, height int, filter gi
}
return img.Bounds().Intersect(rect), nil
}