From b97e7e1281bc33b873532938495aa02ed5cbb418 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Tue, 14 Jul 2026 20:06:44 -0500 Subject: fix: restore optional username in PerformSearch, apply gofmt The golangci-lint cleanup added a top-level `user == nil` guard to PerformSearch, but `user` is variadic and only required for the 'g' and 'f' scopes. The guard made every 'a'/'t' search fail with "missing username" before issuing a request, breaking general search for all callers. The correctly scoped check inside the 'g','f' case already covers the case that needs it. Also run gofmt: the same cleanup introduced space indentation in deviantion.go, user-group.go, and util.go, which fails the gofmt CI step. --- deviantion.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'deviantion.go') diff --git a/deviantion.go b/deviantion.go index 197f2af..12c7a14 100644 --- a/deviantion.go +++ b/deviantion.go @@ -58,7 +58,7 @@ type Deviation struct { // её выпердыши type Media struct { BaseUri string - Name string `json:"prettyName"` + Name string `json:"prettyName"` Token []string Types []struct { T string @@ -109,7 +109,7 @@ func UrlFromMedia(m Media, thumb ...int) (urlParsed, wellFormattedFilename strin if len(thumb) != 0 { subtractWidthHeight(thumb[0], &t.W, &t.H) } - wellFormattedFilename = m.Name + m.BaseUri[l-4:] + wellFormattedFilename = m.Name + m.BaseUri[l-4:] url.WriteString("/v1/fit/w_") url.WriteString(strconv.Itoa(t.W)) @@ -126,7 +126,7 @@ func UrlFromMedia(m Media, thumb ...int) (urlParsed, wellFormattedFilename strin } } - urlParsed = url.String() + urlParsed = url.String() return } @@ -149,14 +149,14 @@ func GetDeviation(id string, user string) (st Post, err Error) { } } - if err := json.Unmarshal([]byte(txt), &description); err != nil { - // Handle error appropriately - try(err) // or log/return the error - } - for _, a := range description.Blocks { - txt = a.Text - } - } + if err := json.Unmarshal([]byte(txt), &description); err != nil { + // Handle error appropriately + try(err) // or log/return the error + } + for _, a := range description.Blocks { + txt = a.Text + } + } st.Description = txt return -- cgit v1.2.3