Skip to content

Commit

Permalink
No need for dataFromBody to be a method of Server.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjkw31 committed Oct 25, 2024
1 parent 623b4f7 commit 8281828
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/analytics.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (s *Server) handleAnalytics(c *gin.Context) (int, error) {
return code, err
}

sessionID, code, err := s.dataFromBody(c)
sessionID, code, err := dataFromBody(c)
if sessionID == "" {
return code, err
}
Expand Down Expand Up @@ -118,7 +118,7 @@ func (s *Server) dataFromHeaders(c *gin.Context) (string, url.Values, int, error
return username.Username, u.Query(), 0, nil
}

func (s *Server) dataFromBody(c *gin.Context) (string, int, error) {
func dataFromBody(c *gin.Context) (string, int, error) {
data := sessionPool.Get().(*[14]byte) //nolint:forcetypeassert,errcheck
defer sessionPool.Put(data)

Expand Down

0 comments on commit 8281828

Please sign in to comment.