From 3acdac8b35c562b57bdce3f017a8db54792217c2 Mon Sep 17 00:00:00 2001 From: oppiliappan Date: Sun, 27 Jul 2025 15:24:39 +0100 Subject: [PATCH] appview: apply gopls lints - remove returns at end of function - replace loop with copy Signed-off-by: oppiliappan --- appview/knots/knots.go | 1 - appview/pulls/pulls.go | 5 ----- appview/repo/repo.go | 4 ---- appview/spindles/spindles.go | 6 +----- appview/state/profile.go | 3 --- 5 files changed, 1 insertion(+), 18 deletions(-) diff --git a/appview/knots/knots.go b/appview/knots/knots.go index 33c2224b..68125f4a 100644 --- a/appview/knots/knots.go +++ b/appview/knots/knots.go @@ -378,7 +378,6 @@ func (k *Knots) members(w http.ResponseWriter, r *http.Request) { } w.Write([]byte(strings.Join(memberDids, "\n"))) - return } // add member to domain, requires auth and requires invite access diff --git a/appview/pulls/pulls.go b/appview/pulls/pulls.go index 9b503517..ef34ab0a 100644 --- a/appview/pulls/pulls.go +++ b/appview/pulls/pulls.go @@ -597,7 +597,6 @@ func (s *Pulls) RepoPulls(w http.ResponseWriter, r *http.Request) { FilteringBy: state, Stacks: stacks, }) - return } func (s *Pulls) PullComment(w http.ResponseWriter, r *http.Request) { @@ -1658,7 +1657,6 @@ func (s *Pulls) resubmitPullHelper( } s.pages.HxLocation(w, fmt.Sprintf("/%s/pulls/%d", f.OwnerSlashRepo(), pull.PullId)) - return } func (s *Pulls) resubmitStackedPullHelper( @@ -1902,7 +1900,6 @@ func (s *Pulls) resubmitStackedPullHelper( } s.pages.HxLocation(w, fmt.Sprintf("/%s/pulls/%d", f.OwnerSlashRepo(), pull.PullId)) - return } func (s *Pulls) MergePull(w http.ResponseWriter, r *http.Request) { @@ -2073,7 +2070,6 @@ func (s *Pulls) ClosePull(w http.ResponseWriter, r *http.Request) { } s.pages.HxLocation(w, fmt.Sprintf("/%s/pulls/%d", f.OwnerSlashRepo(), pull.PullId)) - return } func (s *Pulls) ReopenPull(w http.ResponseWriter, r *http.Request) { @@ -2142,7 +2138,6 @@ func (s *Pulls) ReopenPull(w http.ResponseWriter, r *http.Request) { } s.pages.HxLocation(w, fmt.Sprintf("/%s/pulls/%d", f.OwnerSlashRepo(), pull.PullId)) - return } func newStack(f *reporesolver.ResolvedRepo, user *oauth.User, targetBranch, patch string, pullSource *db.PullSource, stackId string) (db.Stack, error) { diff --git a/appview/repo/repo.go b/appview/repo/repo.go index a8bb761e..a68c1d10 100644 --- a/appview/repo/repo.go +++ b/appview/repo/repo.go @@ -177,7 +177,6 @@ func (rp *Repo) RepoDescriptionEdit(w http.ResponseWriter, r *http.Request) { rp.pages.EditRepoDescriptionFragment(w, pages.RepoDescriptionParams{ RepoInfo: f.RepoInfo(user), }) - return } func (rp *Repo) RepoDescription(w http.ResponseWriter, r *http.Request) { @@ -454,7 +453,6 @@ func (rp *Repo) RepoTags(w http.ResponseWriter, r *http.Request) { ArtifactMap: artifactMap, DanglingArtifacts: danglingArtifacts, }) - return } func (rp *Repo) RepoBranches(w http.ResponseWriter, r *http.Request) { @@ -543,7 +541,6 @@ func (rp *Repo) RepoBlob(w http.ResponseWriter, r *http.Request) { ShowRendered: showRendered, RenderToggle: renderToggle, }) - return } func (rp *Repo) RepoBlobRaw(w http.ResponseWriter, r *http.Request) { @@ -587,7 +584,6 @@ func (rp *Repo) RepoBlobRaw(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/plain; charset=utf-8") w.Write([]byte(result.Contents)) - return } // modify the spindle configured for this repo diff --git a/appview/spindles/spindles.go b/appview/spindles/spindles.go index 10db0672..bf7dfbdf 100644 --- a/appview/spindles/spindles.go +++ b/appview/spindles/spindles.go @@ -114,9 +114,7 @@ func (s *Spindles) dashboard(w http.ResponseWriter, r *http.Request) { } identsToResolve := make([]string, len(members)) - for i, member := range members { - identsToResolve[i] = member - } + copy(identsToResolve, members) resolvedIds := s.IdResolver.ResolveIdents(r.Context(), identsToResolve) didHandleMap := make(map[string]string) for _, identity := range resolvedIds { @@ -258,7 +256,6 @@ func (s *Spindles) register(w http.ResponseWriter, r *http.Request) { // ok s.Pages.HxRefresh(w) - return } func (s *Spindles) delete(w http.ResponseWriter, r *http.Request) { @@ -711,5 +708,4 @@ func (s *Spindles) removeMember(w http.ResponseWriter, r *http.Request) { // ok s.Pages.HxRefresh(w) - return } diff --git a/appview/state/profile.go b/appview/state/profile.go index d6c8edb2..8805efcd 100644 --- a/appview/state/profile.go +++ b/appview/state/profile.go @@ -265,7 +265,6 @@ func (s *State) UpdateProfileBio(w http.ResponseWriter, r *http.Request) { } s.updateProfile(profile, w, r) - return } func (s *State) UpdateProfilePins(w http.ResponseWriter, r *http.Request) { @@ -305,7 +304,6 @@ func (s *State) UpdateProfilePins(w http.ResponseWriter, r *http.Request) { profile.PinnedRepos = pinnedRepos s.updateProfile(profile, w, r) - return } func (s *State) updateProfile(profile *db.Profile, w http.ResponseWriter, r *http.Request) { @@ -373,7 +371,6 @@ func (s *State) updateProfile(profile *db.Profile, w http.ResponseWriter, r *htt s.notifier.UpdateProfile(r.Context(), profile) s.pages.HxRedirect(w, "/"+user.Did) - return } func (s *State) EditBioFragment(w http.ResponseWriter, r *http.Request) { -- 2.51.2