tools: format most examples and tutorials, add them to v test-cleancode (#9826)

This commit is contained in:
Lukas Neubert 2021-04-20 16:16:35 +02:00 committed by GitHub
parent dff50686d6
commit 16e79bc3ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 471 additions and 433 deletions

5
examples/v_script.vsh Executable file → Normal file
View file

@ -1,9 +1,10 @@
#!/usr/local/bin/v run
// The shebang above associates the file to V on Unix-like systems,
// so it can be run just by specifying the path to the file
// once it's made executable using `chmod +x`.
for _ in 0..3 {
for _ in 0 .. 3 {
println('V script')
}
@ -16,7 +17,7 @@ files := ls('.') or { panic(err.msg) }
println(files)
println('\nCreating foo.txt')
create('foo.txt')?
create('foo.txt') ?
println('\nFiles:')
again_ls := ls('.') or { panic(err.msg) }