mirror of
https://github.com/vlang/v.git
synced 2025-09-15 15:32:27 +03:00
ci: rename duplicate example files, to make them unique, and reduce false positives in v build-examples
on windows.
This commit is contained in:
parent
d86a11c257
commit
131052c1ed
3 changed files with 0 additions and 0 deletions
|
@ -1,40 +0,0 @@
|
|||
module main
|
||||
|
||||
import vweb
|
||||
|
||||
const port = 8082
|
||||
|
||||
struct App {
|
||||
vweb.Context
|
||||
}
|
||||
|
||||
fn main() {
|
||||
vweb.run(&App{}, port)
|
||||
}
|
||||
|
||||
pub fn (mut app App) index() vweb.Result {
|
||||
return $vweb.html()
|
||||
}
|
||||
|
||||
@['/upload'; post]
|
||||
pub fn (mut app App) upload() vweb.Result {
|
||||
fdata := app.files['upfile']
|
||||
|
||||
data_rows := fdata[0].data.split('\n')
|
||||
|
||||
mut output_data := ''
|
||||
|
||||
for elem in data_rows {
|
||||
delim_row := elem.split('\t')
|
||||
output_data += '${delim_row[0]}\t${delim_row[1]}\t${delim_row[0].int() + delim_row[1].int()}\n'
|
||||
}
|
||||
|
||||
output_data = output_data.all_before_last('\n')
|
||||
|
||||
println(output_data)
|
||||
|
||||
app.add_header('Content-Disposition', 'attachment; filename=results.txt')
|
||||
app.send_response_to_client('application/octet-stream', output_data)
|
||||
|
||||
return $vweb.html()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue