Skip to content

Commit

Permalink
fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
samber committed Feb 10, 2024
1 parent 62202e0 commit 9170ba6
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 9 deletions.
3 changes: 3 additions & 0 deletions docs/docs/service-lifecycle/healthchecker.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ type HealthcheckerWithContext interface {
Example:

```go
// Ensure at compile-time MyService implements do.HealthcheckerWithContext
var _ do.HealthcheckerWithContext = (*MyService)(nil)

type MyService struct {}

func (*MyService) HealthCheck(context.Context) error {
Expand Down
3 changes: 3 additions & 0 deletions docs/docs/service-lifecycle/shutdowner.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ type ShutdownerWithContextAndError interface {
Example:

```go
// Ensure at compile-time MyService implements do.ShutdownerWithContextAndError
var _ do.ShutdownerWithContextAndError = (*MyService)(nil)

type MyService struct {}

func (*MyService) Shutdown(context.Context) error {
Expand Down
2 changes: 1 addition & 1 deletion examples/http/chi/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ replace github.com/samber/do/http/chi/v2 => ../../../http/chi
require (
github.com/go-chi/chi/v5 v5.0.11
github.com/samber/do/v2 v2.0.0-00010101000000-000000000000
github.com/samber/do/http/chi/v2 v0.0.0-00010101000000-000000000000
github.com/samber/do/http/chi/v2 v2.0.0-00010101000000-000000000000
)

require (
Expand Down
2 changes: 1 addition & 1 deletion examples/http/echo/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ replace github.com/samber/do/http/echo/v2 => ../../../http/echo
require (
github.com/labstack/echo/v4 v4.11.4
github.com/samber/do/v2 v2.0.0-00010101000000-000000000000
github.com/samber/do/http/echo/v2 v0.0.0-00010101000000-000000000000
github.com/samber/do/http/echo/v2 v2.0.0-00010101000000-000000000000
)

require (
Expand Down
2 changes: 1 addition & 1 deletion examples/http/fiber/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ replace github.com/samber/do/http/fiber/v2 => ../../../http/fiber
require (
github.com/gofiber/fiber/v2 v2.51.0
github.com/samber/do/v2 v2.0.0-00010101000000-000000000000
github.com/samber/do/http/fiber/v2 v0.0.0-00010101000000-000000000000
github.com/samber/do/http/fiber/v2 v2.0.0-00010101000000-000000000000
)

require (
Expand Down
4 changes: 2 additions & 2 deletions examples/http/gin/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ replace github.com/samber/do/http/gin/v2 => ../../../http/gin

require (
github.com/gin-gonic/gin v1.9.1
github.com/samber/do/v2 v2.0.0-00010101000000-000000000000
github.com/samber/do/http/gin/v2 v2.0.0-00010101000000-000000000000
github.com/samber/do/v2 v2.0.0-00010101000000-000000000000
)

require (
Expand All @@ -28,7 +28,7 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/samber/go-type-to-string v1.1.0 // indirect
github.com/samber/go-type-to-string v1.2.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
golang.org/x/arch v0.3.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions examples/http/gin/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZ
github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4=
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/samber/go-type-to-string v1.1.0 h1:HDCOY96iOnkzRF5D/FeZV5W4k7Jg/Qg26GhgOD5cmNI=
github.com/samber/go-type-to-string v1.1.0/go.mod h1:jpU77vIDoIxkahknKDoEx9C8bQ1ADnh2sotZ8I4QqBU=
github.com/samber/go-type-to-string v1.2.0 h1:Pvdqx3r/EHn9/DTKoW6RoHz/850s5yV1vA6MqKKG5Ys=
github.com/samber/go-type-to-string v1.2.0/go.mod h1:jpU77vIDoIxkahknKDoEx9C8bQ1ADnh2sotZ8I4QqBU=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
Expand Down
2 changes: 1 addition & 1 deletion examples/http/gin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ func main() {
router := gin.New()
ginhttp.Use(router.Group("/debug/do"), injector)

router.Run(":8080")
router.Run(":8088")
}
2 changes: 1 addition & 1 deletion examples/http/std/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ replace github.com/samber/do/http/std/v2 => ../../../http/std

require (
github.com/samber/do/v2 v2.0.0-00010101000000-000000000000
github.com/samber/do/http/std/v2 v0.0.0-00010101000000-000000000000
github.com/samber/do/http/std/v2 v2.0.0-00010101000000-000000000000
)

require github.com/samber/go-type-to-string v1.1.0 // indirect

0 comments on commit 9170ba6

Please sign in to comment.