1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-11-24 08:57:03 -05:00

adjust to ugly linting

This commit is contained in:
Michael Jerger 2023-12-29 09:43:10 +01:00
parent e704e5adcc
commit 3c2493902d
3 changed files with 4 additions and 4 deletions

View file

@ -61,7 +61,7 @@ func newActorID(validatedURI *url.URL, source string) (ActorID, error) {
return result, nil return result, nil
} }
func NewPersonID(uri string, source string) (PersonID, error) { func NewPersonID(uri, source string) (PersonID, error) {
// TODO: remove after test // TODO: remove after test
//if !validation.IsValidExternalURL(uri) { //if !validation.IsValidExternalURL(uri) {
// return PersonId{}, fmt.Errorf("uri %s is not a valid external url", uri) // return PersonId{}, fmt.Errorf("uri %s is not a valid external url", uri)
@ -85,7 +85,7 @@ func NewPersonID(uri string, source string) (PersonID, error) {
return personID, nil return personID, nil
} }
func NewRepositoryID(uri string, source string) (RepositoryID, error) { func NewRepositoryID(uri, source string) (RepositoryID, error) {
if !validation.IsAPIURL(uri) { if !validation.IsAPIURL(uri) {
return RepositoryID{}, fmt.Errorf("uri %s is not a valid repo url on this host %s", uri, setting.AppURL+"api") return RepositoryID{}, fmt.Errorf("uri %s is not a valid repo url on this host %s", uri, setting.AppURL+"api")
} }

View file

@ -37,7 +37,7 @@ type Star struct {
// StarNew initializes a Star type activity // StarNew initializes a Star type activity
// ToDo: May be used later in creating signed activities // ToDo: May be used later in creating signed activities
func StarNew(id ap.ID, ob ap.ID) *Star { func StarNew(id, ob ap.ID) *Star {
a := ap.ActivityNew(id, StarType, ob) a := ap.ActivityNew(id, StarType, ob)
o := Star{Activity: *a, Source: ForgejoSourceType} o := Star{Activity: *a, Source: ForgejoSourceType}
return &o return &o

View file

@ -21,7 +21,7 @@ func IsValid(v Validateable) (bool, error) {
return true, nil return true, nil
} }
func ValidateNotEmpty(value string, fieldName string) []string { func ValidateNotEmpty(value, fieldName string) []string {
if value == "" { if value == "" {
return []string{fmt.Sprintf("Field %v may not be empty", fieldName)} return []string{fmt.Sprintf("Field %v may not be empty", fieldName)}
} }