-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove duplication in asynchttpserver examples #16586
remove duplication in asynchttpserver examples #16586
Conversation
b10138e
to
21d336d
Compare
So, instead of some code duplication, we now have a runnable example which most likely will never be run. People found the previous bug just by copy-pasting and running the example. If they do the same now, nothing will happen because of |
|
Why is this an |
it's intentional, otherwise the code is never semchecked and makes the runnableExamples much less useful for CI; it's a good pattern IMO, to use whenever we want the example to keep compiling but not run by default unless a flag is specified case in point: see nim-lang/fusion#67 (just today), where a bug was found thanks to |
* remove duplication in asynchttpserver examples * fixup * add comment showing how to run snippet locally
IMO that example will be very confusing for people who read asynchttpserver's docs. I understand that it reduces code duplication, but generally, the examples in stdlib that we have don't need to be run from the module itself. |
* remove duplication in asynchttpserver examples * fixup * add comment showing how to run snippet locally
fixes bug 2 in #16506 (comment)
followup after #16580
can test server with:
nim doc -r --doccmd:-d:nimAsynchttpserverEnableTest lib/pure/asynchttpserver.nim