Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21.1-alpine3.18 AS builder
FROM golang:1.25-alpine AS builder

RUN apk update && apk add --no-cache git

Expand All @@ -8,7 +8,7 @@ RUN go get ./
RUN CGO_ENABLED=0 go build -o /app/http-mockery
RUN chmod +x /app/http-mockery

FROM alpine:3.18
FROM alpine:3.23

COPY --from=builder /app/http-mockery /go/bin/http-mockery
RUN apk update && apk add --no-cache ca-certificates
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module github.com/UpCloudLtd/http-mockery

go 1.21
go 1.24

require (
github.com/stretchr/testify v1.8.4
github.com/stretchr/testify v1.11.1
github.com/valyala/fasttemplate v1.2.2
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
Expand Down
6 changes: 2 additions & 4 deletions pkg/mockery/mockery.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@
"github.com/valyala/fasttemplate"
)

var (
ErrEndpointNotFound = fmt.Errorf("no matching endpoint found")
)
var ErrEndpointNotFound = fmt.Errorf("no matching endpoint found")

var validHTTPMethods = []string{http.MethodGet, http.MethodPost, http.MethodPut, http.MethodPost, http.MethodDelete}
var validHTTPMethods = []string{http.MethodGet, http.MethodPost, http.MethodPut, http.MethodDelete, http.MethodPatch}

const (
EndpointTypeNormal = "normal"
Expand Down Expand Up @@ -91,7 +89,7 @@
}
}
if !validMethod {
return fmt.Errorf(fmt.Sprintf("Invalid HTTP method (%s) for endpoint %s. Allowed: %+v", endpoint.Method, endpoint.Uri, validHTTPMethods))

Check failure on line 92 in pkg/mockery/mockery.go

View workflow job for this annotation

GitHub Actions / test (1.21.x)

non-constant format string in call to fmt.Errorf
}

validType := false
Expand All @@ -102,7 +100,7 @@
}
}
if !validType {
return fmt.Errorf(fmt.Sprintf("Invalid endpoint type (%s) for endpoint %s. Allowed: %+v", endpoint.Type, endpoint.Uri, validEndpointTypes))

Check failure on line 103 in pkg/mockery/mockery.go

View workflow job for this annotation

GitHub Actions / test (1.21.x)

non-constant format string in call to fmt.Errorf
}

if endpoint.Template != "" {
Expand Down
Loading