Skip to content

Commit

Permalink
Merge pull request #104 from Scalingo/feat/92/negroni_v3
Browse files Browse the repository at this point in the history
build(go.mod): update `github.com/urfave/negroni` from v1 to v3
  • Loading branch information
EtienneM authored Dec 23, 2024
2 parents 39cce85 + 0767db3 commit 4762f60
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 13 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## To be Released

* build(go.mod): update github.com/urfave/negroni from v1 to v3

## v1.8.2

* feat(middleware): add a middleware to set the `Content-Type` to `application/json`
Expand Down
2 changes: 1 addition & 1 deletion error_middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"

"github.com/sirupsen/logrus"
"github.com/urfave/negroni"
"github.com/urfave/negroni/v3"

"github.com/Scalingo/go-utils/errors/v2"
"github.com/Scalingo/go-utils/logger"
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/Scalingo/go-handlers

go 1.22.9
go 1.22.10

require (
github.com/Scalingo/go-utils/errors/v2 v2.4.0
Expand All @@ -11,14 +11,14 @@ require (
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.10.0
github.com/urfave/negroni v1.0.0
gopkg.in/errgo.v1 v1.0.1
github.com/urfave/negroni/v3 v3.1.1
)

require (
github.com/Scalingo/go-utils/crypto v1.0.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/sys v0.27.0 // indirect
gopkg.in/errgo.v1 v1.0.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/urfave/negroni v1.0.0 h1:kIimOitoypq34K7TG7DUaJ9kq/N4Ofuwi1sjz0KipXc=
github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4=
github.com/urfave/negroni/v3 v3.1.1 h1:6MS4nG9Jk/UuCACaUlNXCbiKa0ywF9LXz5dGu09v8hw=
github.com/urfave/negroni/v3 v3.1.1/go.mod h1:jWvnX03kcSjDBl/ShB0iHvx5uOs7mAzZXW+JvJ5XYAs=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
Expand Down
2 changes: 1 addition & 1 deletion logging_middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"time"

"github.com/sirupsen/logrus"
"github.com/urfave/negroni"
"github.com/urfave/negroni/v3"
)

var (
Expand Down
11 changes: 5 additions & 6 deletions profiling_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import (
"os"
"strconv"

"gopkg.in/errgo.v1"

"github.com/Scalingo/go-utils/errors/v2"
"github.com/Scalingo/go-utils/logger"
)

Expand All @@ -29,9 +28,9 @@ func NewProfilingRouter(ctx context.Context) (*Router, error) {

prof := new(profiling)

err := prof.initialize()
err := prof.initialize(ctx)
if err != nil {
return nil, errgo.Notef(err, "fail to initialize pprof profiling")
return nil, errors.Wrap(ctx, err, "initialize pprof profiling")
}

if !prof.isActivable() {
Expand Down Expand Up @@ -64,7 +63,7 @@ func NewProfilingRouter(ctx context.Context) (*Router, error) {
return r, nil
}

func (prof *profiling) initialize() error {
func (prof *profiling) initialize(ctx context.Context) error {
pprofEnable := os.Getenv("PPROF_ENABLED")
if pprofEnable == "" {
return nil
Expand All @@ -73,7 +72,7 @@ func (prof *profiling) initialize() error {
var err error
prof.enable, err = strconv.ParseBool(pprofEnable)
if err != nil {
return errgo.Notef(err, "fail to parse environment variable PPROF_ENABLED")
return errors.Wrap(ctx, err, "parse environment variable PPROF_ENABLED")
}
prof.auth.username = os.Getenv("PPROF_USERNAME")
prof.auth.password = os.Getenv("PPROF_PASSWORD")
Expand Down

0 comments on commit 4762f60

Please sign in to comment.