style: gofmt

This commit is contained in:
Jakub Zych
2026-11-05 01:00:47 +01:00
parent cf13c606f8
commit b8d98cef2b
2 changed files with 12 additions and 12 deletions

View File

@@ -699,17 +699,17 @@ func TestBlogEditorUpload(t *testing.T) {
t.Run("names are made safe", func(t *testing.T) {
for in, want := range map[string]string{
"Zdjęcie 1.PNG": "zdjecie-1.png",
`C:\\Users\\x\\My Photo.jpg`: "my-photo.jpg",
"../../etc/passwd.png": "passwd.png",
"...": "image",
"": "image",
"-.-a-.png": "a.png",
"a--b__c.webp": "a-b-c.webp",
"<script>.gif": "script.gif",
`x" onerror="alert(1).png`: "x-onerror-alert-1.png",
"name.with.dots.jpeg": "name-with-dots.jpeg",
"weird.ext$": "weird-ext",
"Zdjęcie 1.PNG": "zdjecie-1.png",
`C:\\Users\\x\\My Photo.jpg`: "my-photo.jpg",
"../../etc/passwd.png": "passwd.png",
"...": "image",
"": "image",
"-.-a-.png": "a.png",
"a--b__c.webp": "a-b-c.webp",
"<script>.gif": "script.gif",
`x" onerror="alert(1).png`: "x-onerror-alert-1.png",
"name.with.dots.jpeg": "name-with-dots.jpeg",
"weird.ext$": "weird-ext",
} {
if got := safeUploadName(in); got != want {
t.Fatalf("safeUploadName(%q) = %q, want %q", in, got, want)