Make gofmt happy
This commit is contained in:
parent
b9dd4a2f5f
commit
819e495dc0
4 changed files with 7 additions and 5 deletions
|
@ -83,9 +83,11 @@ func repositoryIRIToOwnerIRI(repoIRI ap.IRI) (ap.IRI, error) {
|
||||||
r := repoIRI.String()
|
r := repoIRI.String()
|
||||||
rSplit := strings.Split(r, "/")
|
rSplit := strings.Split(r, "/")
|
||||||
if len(rSplit) < 5 {
|
if len(rSplit) < 5 {
|
||||||
return "", errors.New("Not a Repository actor IRI")
|
return "", errors.New("not a Repository actor IRI")
|
||||||
}
|
}
|
||||||
|
|
||||||
username := rSplit[len(rSplit)-2]
|
username := rSplit[len(rSplit)-2]
|
||||||
reponame := rSplit[len(rSplit)-1]
|
reponame := rSplit[len(rSplit)-1]
|
||||||
return ap.IRI(strings.TrimSuffix(r, "repo/"+username+"/"+reponame)+"user/"+username), nil
|
ownerIRI := ap.IRI(strings.TrimSuffix(r, "repo/"+username+"/"+reponame) + "user/" + username)
|
||||||
|
return ownerIRI, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,8 @@ import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"code.gitea.io/gitea/models"
|
"code.gitea.io/gitea/models"
|
||||||
repo_service "code.gitea.io/gitea/services/repository"
|
|
||||||
"code.gitea.io/gitea/modules/forgefed"
|
"code.gitea.io/gitea/modules/forgefed"
|
||||||
|
repo_service "code.gitea.io/gitea/services/repository"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Create a new federated repo from a Repository object
|
// Create a new federated repo from a Repository object
|
||||||
|
|
Loading…
Add table
Reference in a new issue