mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-04-19 13:00:20 +00:00
First round of patches to re-enable some lints from my side. This PR also refactors the general key fetching code quite a bit due to the way it currently worked with relying on some values being nil sometimes. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/11253 Reviewed-by: elle <0xllx0@noreply.codeberg.org> Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: famfo <famfo@famfo.xyz> Co-committed-by: famfo <famfo@famfo.xyz>
22 lines
504 B
Go
22 lines
504 B
Go
// Copyright 2026 The Forgejo Authors. All rights reserved.
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
package forgefed
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
type ErrFederationHostNotFound struct {
|
|
SearchKey string
|
|
SearchValue string
|
|
}
|
|
|
|
func (err ErrFederationHostNotFound) Error() string {
|
|
return fmt.Sprintf("ErrFederationHostNotFound: search key: %s, search value: %s", err.SearchKey, err.SearchValue)
|
|
}
|
|
|
|
func IsErrFederationHostNotFound(err error) bool {
|
|
_, ok := err.(ErrFederationHostNotFound)
|
|
return ok
|
|
}
|