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:
@ -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()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user