all: clean up code, upgrade to modern Go

Signed-off-by: ddkwork
This commit is contained in:
Admin
2025-05-05 23:27:04 +08:00
committed by Elias Naur
parent 86668e8b45
commit f73287be87
58 changed files with 413 additions and 241 deletions
+10 -5
View File
@@ -31,7 +31,8 @@ func TestFit(t *testing.T) {
Dims: image.Point{50, 200},
Scale: f32.Point{X: 1, Y: 1},
Result: image.Point{X: 50, Y: 100},
}},
},
},
Contain: {
{
Dims: image.Point{50, 25},
@@ -41,7 +42,8 @@ func TestFit(t *testing.T) {
Dims: image.Point{50, 200},
Scale: f32.Point{X: 0.5, Y: 0.5},
Result: image.Point{X: 25, Y: 100},
}},
},
},
Cover: {
{
Dims: image.Point{50, 25},
@@ -51,7 +53,8 @@ func TestFit(t *testing.T) {
Dims: image.Point{50, 200},
Scale: f32.Point{X: 2, Y: 2},
Result: image.Point{X: 100, Y: 100},
}},
},
},
ScaleDown: {
{
Dims: image.Point{50, 25},
@@ -61,7 +64,8 @@ func TestFit(t *testing.T) {
Dims: image.Point{50, 200},
Scale: f32.Point{X: 0.5, Y: 0.5},
Result: image.Point{X: 25, Y: 100},
}},
},
},
Fill: {
{
Dims: image.Point{50, 25},
@@ -71,7 +75,8 @@ func TestFit(t *testing.T) {
Dims: image.Point{50, 200},
Scale: f32.Point{X: 2, Y: 0.5},
Result: image.Point{X: 100, Y: 100},
}},
},
},
}
for fit, tests := range fittests {