A .kts
file doesn't require a main
function. You can add the print statement at the top level.
This would explain the warning about args
being unused, since main
is never invoked.
A script is a Kotlin source file (.kts) with top level executable code.
Using the command line to run scripts
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.