mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
tools: format most examples and tutorials, add them to v test-cleancode
(#9826)
This commit is contained in:
parent
dff50686d6
commit
16e79bc3ca
38 changed files with 471 additions and 433 deletions
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue