ci: run VAUTOFIX=1 ./v check-md -hide-warnings . to fix doc failures

This commit is contained in:
Delyan Angelov 2023-11-25 09:34:46 +02:00
parent c963dc619e
commit 5e37798560
No known key found for this signature in database
GPG key ID: 66886C0F12D595ED
6 changed files with 27 additions and 41 deletions

View file

@ -2926,10 +2926,8 @@ To dereference a reference, use the `*` operator, just like in C.
## Constants ## Constants
```v ```v
const ( const pi = 3.14
pi = 3.14 const world = '世界'
world = '世界'
)
println(pi) println(pi)
println(world) println(world)
@ -2961,16 +2959,14 @@ fn rgb(r int, g int, b int) Color {
} }
} }
const ( const numbers = [1, 2, 3]
numbers = [1, 2, 3] const red = Color{
red = Color{ r: 255
r: 255 g: 0
g: 0 b: 0
b: 0 }
} // evaluate function call at compile time*
// evaluate function call at compile time* const blue = rgb(0, 0, 255)
blue = rgb(0, 0, 255)
)
println(numbers) println(numbers)
println(red) println(red)
@ -7157,4 +7153,4 @@ Assignment Operators
+= -= *= /= %= += -= *= /= %=
&= |= ^= &= |= ^=
>>= <<= >>>= >>= <<= >>>=
``` ```

View file

@ -115,9 +115,7 @@ module main
import vweb import vweb
import os import os
const ( const http_port = 3001
http_port = 3001
)
struct App { struct App {
vweb.Context vweb.Context
@ -145,4 +143,4 @@ pub fn (mut app App) controller_get_all_task() vweb.Result {
file := os.read_file('./index.html') or { panic(err) } file := os.read_file('./index.html') or { panic(err) }
return app.html(file) return app.html(file)
} }
``` ```

View file

@ -117,9 +117,7 @@ module main
import vweb import vweb
import os import os
const ( const http_port = 3001
http_port = 3001
)
struct App { struct App {
vweb.Context vweb.Context
@ -147,4 +145,4 @@ pub fn (mut app App) controller_get_all_task() vweb.Result {
file := os.read_file('./index.html') or { panic(err) } file := os.read_file('./index.html') or { panic(err) }
return app.html(file) return app.html(file)
} }
``` ```

View file

@ -63,9 +63,7 @@ module main
import eventbus import eventbus
// initialize it globally // initialize it globally
const ( const eb = eventbus.new[string]()
eb = eventbus.new[string]()
)
fn main() { fn main() {
// get a mutable reference to the subscriber // get a mutable reference to the subscriber
@ -121,4 +119,4 @@ fn do_work() {
This is mainly for security because if publisher & subscriber are both passed around, This is mainly for security because if publisher & subscriber are both passed around,
a client can easily publish events acting as the server. a client can easily publish events acting as the server.
So a client should only be able to use the Subscriber methods. So a client should only be able to use the Subscriber methods.

View file

@ -16,10 +16,8 @@ import time
import math import math
import sokol.audio import sokol.audio
const ( const sw = time.new_stopwatch()
sw = time.new_stopwatch() const sw_start_ms = sw.elapsed().milliseconds()
sw_start_ms = sw.elapsed().milliseconds()
)
@[inline] @[inline]
fn sintone(periods int, frame int, num_frames int) f32 { fn sintone(periods int, frame int, num_frames int) f32 {
@ -54,4 +52,4 @@ fn main() {
time.sleep(2000 * time.millisecond) time.sleep(2000 * time.millisecond)
audio.shutdown() audio.shutdown()
} }
``` ```

View file

@ -247,14 +247,12 @@ import sokol.gfx
import x.ttf import x.ttf
import os import os
const ( const win_width = 600
win_width = 600 const win_height = 700
win_height = 700 const bg_color = gx.white
bg_color = gx.white const font_paths = [
font_paths = [ 'arial.ttf',
'arial.ttf', ]
]
)
struct App_data { struct App_data {
pub mut: pub mut:
@ -332,4 +330,4 @@ fn main() {
app.gg.run() app.gg.run()
} }
``` ```