clj-kondo is complaining about an “unused binding req” in my Ring handler function (I’m using org.httpkit.server). From what I read here: https://github.com/ring-clojure/ring/wiki/Concepts I have to have at least one argument, a map representing a request - which makes sense to me, even if I don’t use that map in my function. I imagine req is in fact used somehow, only in a different namespace that the linter can’t see?
Should I just put a silly (comment req) Or what is the best practice here?
Snippet of my code, not that it shows much:
(defn app [req]
{:status 200
:headers {"Content-Type" "text/html"}
:body (tv-dash!)})
(defn -main
"I don't do a whole lot} ... yet."
[& args]
(run-server app {:port 9090}))
In Clojure it is common to use _ as a name for vars when you don’t intend to use them but they are required by an “interface” like request handlers, or when a function returns soething that you might not care about.