Skip to content

Commit 4604227

Browse files
committed
Make stashEntryFromLine a free-standing function
It doesn't use the receiver at all, so doesn't have to be a method. This fixes ST1016: methods on the same type should have the same receiver name.
1 parent b7aecf5 commit 4604227

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/commands/git_commands/stash_loader.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ outer:
5353
if err != nil {
5454
return self.getUnfilteredStashEntries()
5555
}
56-
currentStashEntry = self.stashEntryFromLine(lines[i], idx)
56+
currentStashEntry = stashEntryFromLine(lines[i], idx)
5757
for i+1 < len(lines) && !isAStash(lines[i+1]) {
5858
i++
5959
if lines[i] == filterPath {
@@ -70,11 +70,11 @@ func (self *StashLoader) getUnfilteredStashEntries() []*models.StashEntry {
7070

7171
rawString, _ := self.cmd.New(cmdArgs).DontLog().RunWithOutput()
7272
return lo.Map(utils.SplitNul(rawString), func(line string, index int) *models.StashEntry {
73-
return self.stashEntryFromLine(line, index)
73+
return stashEntryFromLine(line, index)
7474
})
7575
}
7676

77-
func (c *StashLoader) stashEntryFromLine(line string, index int) *models.StashEntry {
77+
func stashEntryFromLine(line string, index int) *models.StashEntry {
7878
model := &models.StashEntry{
7979
Name: line,
8080
Index: index,

0 commit comments

Comments
 (0)