D's had that for many years. It's not a secret! https://dlang.org/phobos/std_algorithm_searching.html#.any See the buttons below the example code. You can even edit the examples and try variations.
I was curious for exactly how long "many years" was, and it appears it was added sometime between 2016 to 2017. The last archive without it is from 2016, the next archive with it is 2017: https://web.archive.org/web/20160405080736/https://dlang.org... Now that's of course just the website feature. Maybe D had executable examples that were tested by the compiler before Go, which would still be very interesting. Howeve…
Sounds like D's ability to specify unit tests in production source code, and have them optionally executed, fits the bill for that.
https://dlang.org/spec/unittest.html
Builtin unit tests were a great leap forward for code verification.