You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The wrapper functions referenced above contain generated code which pulls parameters off the request and unmarshals them into Go objects.
416
+
417
+
You would register the generated handlers as follows:
418
+
419
+
```go
420
+
typePetStoreImplstruct {}
421
+
func(*PetStoreImpl) GetPets(whttp.ResponseWriter, r *http.Request) {
422
+
// Implement me
423
+
}
424
+
425
+
funcSetupHandler() {
426
+
varmyApi PetStoreImpl
427
+
428
+
options:= petstore.StdHTTPServerOptions{
429
+
BaseRouter: http.DefaultServeMux, // Or use a new ServeMux
430
+
}
431
+
petstore.HandlerWithOptions(&myApi, options)
432
+
}
433
+
```
434
+
435
+
**Note** that if you feel like you've done everything right, but are still receiving `404 page not found` errors, make sure that you've got the `go` directive in your `go.mod` updated to:
0 commit comments