mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-30 22:39:58 +02:00
all: Run modernize -fix ./...
This commit is contained in:
@@ -22,6 +22,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/gohugoio/hugo/common/hstrings"
|
||||
"slices"
|
||||
)
|
||||
|
||||
type colorGoProvider interface {
|
||||
@@ -91,11 +92,8 @@ func (c Color) toSRGB(i uint8) float64 {
|
||||
// that the palette is valid for the relevant format.
|
||||
func AddColorToPalette(c color.Color, p color.Palette) color.Palette {
|
||||
var found bool
|
||||
for _, cc := range p {
|
||||
if c == cc {
|
||||
found = true
|
||||
break
|
||||
}
|
||||
if slices.Contains(p, c) {
|
||||
found = true
|
||||
}
|
||||
|
||||
if !found {
|
||||
|
@@ -209,7 +209,7 @@ func goldenEqual(img1, img2 *image.NRGBA) bool {
|
||||
if len(img1.Pix) != len(img2.Pix) {
|
||||
return false
|
||||
}
|
||||
for i := 0; i < len(img1.Pix); i++ {
|
||||
for i := range img1.Pix {
|
||||
diff := int(img1.Pix[i]) - int(img2.Pix[i])
|
||||
if diff < 0 {
|
||||
diff = -diff
|
||||
|
Reference in New Issue
Block a user