Skip to content

Commit

Permalink
fix: golang-ci-lint version + lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
gwleclerc committed Oct 2, 2023
1 parent fd43b3a commit 453021d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ REFLEX=$(GOPATH)/bin/reflex
$(REFLEX):
go install github.com/cespare/reflex@latest

GOLANGCILINTVERSION:=1.32.0
GOLANGCILINTVERSION:=1.54.2
GOLANGCILINT=$(GOPATH)/bin/golangci-lint
$(GOLANGCILINT):
curl -fsSL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v$(GOLANGCILINTVERSION)
Expand Down
3 changes: 2 additions & 1 deletion server/services/persistence.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ func (p *persistence) StoreSessions(sessions types.Sessions) {
}
var sessionsGroup errgroup.Group
for _, session := range sessions {
session := session
sessionsGroup.Go(func() error {
if err := p.createSessionDirectory(session.ID); err != nil {
return err
Expand Down Expand Up @@ -161,6 +162,7 @@ func (p *persistence) LoadSessions() (types.Sessions, error) {
var sessionsGroup errgroup.Group
var sessionsLock sync.Mutex
for _, session := range sessions {
session := session
sessionsGroup.Go(func() error {
historyFile, err := os.Open(filepath.Join(p.persistenceDirectory, session.ID, historyFileName))
if err != nil {
Expand Down Expand Up @@ -235,7 +237,6 @@ func (p *persistence) persistHistory(sessionID string, h types.History) error {
}

func (p *persistence) persistMocks(sessionID string, m types.Mocks) error {

// we need to reverse mocks before storage in order to have a reusable mocks file as mocks are stored as a stack
orderedMocks := make(types.Mocks, 0, len(m))
for i := len(m) - 1; i >= 0; i-- {
Expand Down

0 comments on commit 453021d

Please sign in to comment.