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

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
38 changed files with 471 additions and 433 deletions

View File

@ -19,7 +19,6 @@ fn hello_response() string {
return 'Hello, World!'
}
fn callback(req picohttpparser.Request, mut res picohttpparser.Response) {
if picohttpparser.cmpn(req.method, 'GET ', 4) {
if picohttpparser.cmp(req.path, '/t') {
@ -28,19 +27,16 @@ fn callback(req picohttpparser.Request, mut res picohttpparser.Response) {
res.header_date()
res.plain()
res.body(hello_response())
}
else if picohttpparser.cmp(req.path, '/j') {
} else if picohttpparser.cmp(req.path, '/j') {
res.http_ok()
res.header_server()
res.header_date()
res.json()
res.body(json_response())
}
else {
} else {
res.http_404()
}
}
else {
} else {
res.http_405()
}
}