1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

docs: document the [noinit] attribute with an example (#15876)

This commit is contained in:
Subhomoy Haldar
2022-09-25 17:36:01 +01:00
committed by GitHub
parent 3674baab23
commit 7f23abbf8c
3 changed files with 61 additions and 4 deletions

View File

@@ -541,6 +541,16 @@ fn (mut f MDFile) check_examples() CheckResult {
}
oks++
}
'okfmt' {
if fmt_res != 0 {
eprintln(eline(f.path, e.sline, 0, 'okfmt example is not formatted'))
eprintln(vcontent)
should_cleanup_vfile = false
errors++
continue
}
oks++
}
'badsyntax' {
res := silent_cmdexecute('${os.quoted_path(vexe)} -w -Wfatal-errors -check-syntax ${os.quoted_path(vfile)}')
if res == 0 {
@@ -554,7 +564,7 @@ fn (mut f MDFile) check_examples() CheckResult {
}
'nofmt' {}
else {
eprintln(eline(f.path, e.sline, 0, 'unrecognized command: "$command", use one of: wip/ignore/compile/cgen/failcompile/oksyntax/badsyntax/nofmt'))
eprintln(eline(f.path, e.sline, 0, 'unrecognized command: "$command", use one of: wip/ignore/compile/cgen/failcompile/okfmt/oksyntax/badsyntax/nofmt'))
should_cleanup_vfile = false
errors++
}