summaryrefslogtreecommitdiffstats
path: root/routers/web/user/home.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/user/home.go')
-rw-r--r--routers/web/user/home.go18
1 files changed, 8 insertions, 10 deletions
diff --git a/routers/web/user/home.go b/routers/web/user/home.go
index 04459573af..13fa9bd8c4 100644
--- a/routers/web/user/home.go
+++ b/routers/web/user/home.go
@@ -197,7 +197,7 @@ func Milestones(ctx *context.Context) {
if issueReposQueryPattern.MatchString(reposQuery) {
// remove "[" and "]" from string
reposQuery = reposQuery[1 : len(reposQuery)-1]
- //for each ID (delimiter ",") add to int to repoIDs
+ // for each ID (delimiter ",") add to int to repoIDs
for _, rID := range strings.Split(reposQuery, ",") {
// Ensure nonempty string entries
@@ -350,7 +350,6 @@ func Issues(ctx *context.Context) {
var issueReposQueryPattern = regexp.MustCompile(`^\[\d+(,\d+)*,?\]$`)
func buildIssueOverview(ctx *context.Context, unitType unit.Type) {
-
// ----------------------------------------------------
// Determine user; can be either user or organization.
// Return with NotFound or ServerError if unsuccessful.
@@ -586,8 +585,7 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) {
ctx.Data["IsShowClosed"] = isShowClosed
- ctx.Data["IssueRefEndNames"], ctx.Data["IssueRefURLs"] =
- issue_service.GetRefEndNamesAndURLs(issues, ctx.FormString("RepoLink"))
+ ctx.Data["IssueRefEndNames"], ctx.Data["IssueRefURLs"] = issue_service.GetRefEndNamesAndURLs(issues, ctx.FormString("RepoLink"))
ctx.Data["Issues"] = issues
@@ -661,7 +659,7 @@ func getRepoIDs(reposQuery string) []int64 {
var repoIDs []int64
// remove "[" and "]" from string
reposQuery = reposQuery[1 : len(reposQuery)-1]
- //for each ID (delimiter ",") add to int to repoIDs
+ // for each ID (delimiter ",") add to int to repoIDs
for _, rID := range strings.Split(reposQuery, ",") {
// Ensure nonempty string entries
if rID != "" && rID != "0" {
@@ -693,8 +691,8 @@ func issueIDsFromSearch(ctxUser *user_model.User, keyword string, opts *models.I
}
func loadRepoByIDs(ctxUser *user_model.User, issueCountByRepo map[int64]int64, unitType unit.Type) (map[int64]*repo_model.Repository, error) {
- var totalRes = make(map[int64]*repo_model.Repository, len(issueCountByRepo))
- var repoIDs = make([]int64, 0, 500)
+ totalRes := make(map[int64]*repo_model.Repository, len(issueCountByRepo))
+ repoIDs := make([]int64, 0, 500)
for id := range issueCountByRepo {
if id <= 0 {
continue
@@ -745,7 +743,7 @@ func ShowGPGKeys(ctx *context.Context, uid int64) {
if err != nil {
if asymkey_model.IsErrGPGKeyImportNotExist(err) {
failedEntitiesID = append(failedEntitiesID, k.KeyID)
- continue //Skip previous import without backup of imported armored key
+ continue // Skip previous import without backup of imported armored key
}
ctx.ServerError("ShowGPGKeys", err)
return
@@ -755,12 +753,12 @@ func ShowGPGKeys(ctx *context.Context, uid int64) {
var buf bytes.Buffer
headers := make(map[string]string)
- if len(failedEntitiesID) > 0 { //If some key need re-import to be exported
+ if len(failedEntitiesID) > 0 { // If some key need re-import to be exported
headers["Note"] = fmt.Sprintf("The keys with the following IDs couldn't be exported and need to be reuploaded %s", strings.Join(failedEntitiesID, ", "))
}
writer, _ := armor.Encode(&buf, "PGP PUBLIC KEY BLOCK", headers)
for _, e := range entities {
- err = e.Serialize(writer) //TODO find why key are exported with a different cipherTypeByte as original (should not be blocking but strange)
+ err = e.Serialize(writer) // TODO find why key are exported with a different cipherTypeByte as original (should not be blocking but strange)
if err != nil {
ctx.ServerError("ShowGPGKeys", err)
return