forked from tangled.org/core
Monorepo for Tangled

appview: apply gopls lints

- remove returns at end of function
- replace loop with copy

Signed-off-by: oppiliappan <me@oppi.li>

oppi.li 3acdac8b 4145917b

verified
Changed files
+1 -18
appview
knots
pulls
repo
spindles
state
-1
appview/knots/knots.go
··· 378 } 379 380 w.Write([]byte(strings.Join(memberDids, "\n"))) 381 - return 382 } 383 384 // add member to domain, requires auth and requires invite access
··· 378 } 379 380 w.Write([]byte(strings.Join(memberDids, "\n"))) 381 } 382 383 // add member to domain, requires auth and requires invite access
-5
appview/pulls/pulls.go
··· 597 FilteringBy: state, 598 Stacks: stacks, 599 }) 600 - return 601 } 602 603 func (s *Pulls) PullComment(w http.ResponseWriter, r *http.Request) { ··· 1658 } 1659 1660 s.pages.HxLocation(w, fmt.Sprintf("/%s/pulls/%d", f.OwnerSlashRepo(), pull.PullId)) 1661 - return 1662 } 1663 1664 func (s *Pulls) resubmitStackedPullHelper( ··· 1902 } 1903 1904 s.pages.HxLocation(w, fmt.Sprintf("/%s/pulls/%d", f.OwnerSlashRepo(), pull.PullId)) 1905 - return 1906 } 1907 1908 func (s *Pulls) MergePull(w http.ResponseWriter, r *http.Request) { ··· 2073 } 2074 2075 s.pages.HxLocation(w, fmt.Sprintf("/%s/pulls/%d", f.OwnerSlashRepo(), pull.PullId)) 2076 - return 2077 } 2078 2079 func (s *Pulls) ReopenPull(w http.ResponseWriter, r *http.Request) { ··· 2142 } 2143 2144 s.pages.HxLocation(w, fmt.Sprintf("/%s/pulls/%d", f.OwnerSlashRepo(), pull.PullId)) 2145 - return 2146 } 2147 2148 func newStack(f *reporesolver.ResolvedRepo, user *oauth.User, targetBranch, patch string, pullSource *db.PullSource, stackId string) (db.Stack, error) {
··· 597 FilteringBy: state, 598 Stacks: stacks, 599 }) 600 } 601 602 func (s *Pulls) PullComment(w http.ResponseWriter, r *http.Request) { ··· 1657 } 1658 1659 s.pages.HxLocation(w, fmt.Sprintf("/%s/pulls/%d", f.OwnerSlashRepo(), pull.PullId)) 1660 } 1661 1662 func (s *Pulls) resubmitStackedPullHelper( ··· 1900 } 1901 1902 s.pages.HxLocation(w, fmt.Sprintf("/%s/pulls/%d", f.OwnerSlashRepo(), pull.PullId)) 1903 } 1904 1905 func (s *Pulls) MergePull(w http.ResponseWriter, r *http.Request) { ··· 2070 } 2071 2072 s.pages.HxLocation(w, fmt.Sprintf("/%s/pulls/%d", f.OwnerSlashRepo(), pull.PullId)) 2073 } 2074 2075 func (s *Pulls) ReopenPull(w http.ResponseWriter, r *http.Request) { ··· 2138 } 2139 2140 s.pages.HxLocation(w, fmt.Sprintf("/%s/pulls/%d", f.OwnerSlashRepo(), pull.PullId)) 2141 } 2142 2143 func newStack(f *reporesolver.ResolvedRepo, user *oauth.User, targetBranch, patch string, pullSource *db.PullSource, stackId string) (db.Stack, error) {
-4
appview/repo/repo.go
··· 177 rp.pages.EditRepoDescriptionFragment(w, pages.RepoDescriptionParams{ 178 RepoInfo: f.RepoInfo(user), 179 }) 180 - return 181 } 182 183 func (rp *Repo) RepoDescription(w http.ResponseWriter, r *http.Request) { ··· 454 ArtifactMap: artifactMap, 455 DanglingArtifacts: danglingArtifacts, 456 }) 457 - return 458 } 459 460 func (rp *Repo) RepoBranches(w http.ResponseWriter, r *http.Request) { ··· 543 ShowRendered: showRendered, 544 RenderToggle: renderToggle, 545 }) 546 - return 547 } 548 549 func (rp *Repo) RepoBlobRaw(w http.ResponseWriter, r *http.Request) { ··· 587 588 w.Header().Set("Content-Type", "text/plain; charset=utf-8") 589 w.Write([]byte(result.Contents)) 590 - return 591 } 592 593 // modify the spindle configured for this repo
··· 177 rp.pages.EditRepoDescriptionFragment(w, pages.RepoDescriptionParams{ 178 RepoInfo: f.RepoInfo(user), 179 }) 180 } 181 182 func (rp *Repo) RepoDescription(w http.ResponseWriter, r *http.Request) { ··· 453 ArtifactMap: artifactMap, 454 DanglingArtifacts: danglingArtifacts, 455 }) 456 } 457 458 func (rp *Repo) RepoBranches(w http.ResponseWriter, r *http.Request) { ··· 541 ShowRendered: showRendered, 542 RenderToggle: renderToggle, 543 }) 544 } 545 546 func (rp *Repo) RepoBlobRaw(w http.ResponseWriter, r *http.Request) { ··· 584 585 w.Header().Set("Content-Type", "text/plain; charset=utf-8") 586 w.Write([]byte(result.Contents)) 587 } 588 589 // modify the spindle configured for this repo
+1 -5
appview/spindles/spindles.go
··· 114 } 115 116 identsToResolve := make([]string, len(members)) 117 - for i, member := range members { 118 - identsToResolve[i] = member 119 - } 120 resolvedIds := s.IdResolver.ResolveIdents(r.Context(), identsToResolve) 121 didHandleMap := make(map[string]string) 122 for _, identity := range resolvedIds { ··· 258 259 // ok 260 s.Pages.HxRefresh(w) 261 - return 262 } 263 264 func (s *Spindles) delete(w http.ResponseWriter, r *http.Request) { ··· 711 712 // ok 713 s.Pages.HxRefresh(w) 714 - return 715 }
··· 114 } 115 116 identsToResolve := make([]string, len(members)) 117 + copy(identsToResolve, members) 118 resolvedIds := s.IdResolver.ResolveIdents(r.Context(), identsToResolve) 119 didHandleMap := make(map[string]string) 120 for _, identity := range resolvedIds { ··· 256 257 // ok 258 s.Pages.HxRefresh(w) 259 } 260 261 func (s *Spindles) delete(w http.ResponseWriter, r *http.Request) { ··· 708 709 // ok 710 s.Pages.HxRefresh(w) 711 }
-3
appview/state/profile.go
··· 265 } 266 267 s.updateProfile(profile, w, r) 268 - return 269 } 270 271 func (s *State) UpdateProfilePins(w http.ResponseWriter, r *http.Request) { ··· 305 profile.PinnedRepos = pinnedRepos 306 307 s.updateProfile(profile, w, r) 308 - return 309 } 310 311 func (s *State) updateProfile(profile *db.Profile, w http.ResponseWriter, r *http.Request) { ··· 373 s.notifier.UpdateProfile(r.Context(), profile) 374 375 s.pages.HxRedirect(w, "/"+user.Did) 376 - return 377 } 378 379 func (s *State) EditBioFragment(w http.ResponseWriter, r *http.Request) {
··· 265 } 266 267 s.updateProfile(profile, w, r) 268 } 269 270 func (s *State) UpdateProfilePins(w http.ResponseWriter, r *http.Request) { ··· 304 profile.PinnedRepos = pinnedRepos 305 306 s.updateProfile(profile, w, r) 307 } 308 309 func (s *State) updateProfile(profile *db.Profile, w http.ResponseWriter, r *http.Request) { ··· 371 s.notifier.UpdateProfile(r.Context(), profile) 372 373 s.pages.HxRedirect(w, "/"+user.Did) 374 } 375 376 func (s *State) EditBioFragment(w http.ResponseWriter, r *http.Request) {