oapi-codegen icon indicating copy to clipboard operation
oapi-codegen copied to clipboard

Use `http.MethodXXX` constants instead of string literals

Open corani opened this issue 3 years ago • 0 comments

I found this in the gorilla-server generator, not sure if it's also the case for other server generators.

When setting the Methods for the HandleFunc string literals are used (e.g. "GET") rather than the constants defined in the http package (e.g. http.MethodGet). This is a very minor issue, but if constants exist it's good practice to use them :)

corani avatar Jul 05 '22 10:07 corani