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

move http module to net.http

This commit is contained in:
Abdullah Atta 2019-12-30 09:42:23 +05:00 committed by Alexander Medvednikov
parent 6cee50afda
commit 63b70ddb06
15 changed files with 14 additions and 9 deletions

View File

@ -14,8 +14,8 @@ jobs:
run: make -j4
- name: Build a production tools/vfmt
run: ./v -prod -d vfmt tools/vfmt.v
- name: fmt only the changed files (from master)
run: git diff --name-status origin/master HEAD -- '*.v' |grep -v '^D'|rev|cut -f1|rev| xargs ./v fmt -diff
- name: Run v fmt -diff on only the changed files. Does NOT fail for now.
run: git diff --name-status origin/master HEAD -- '*.v' |grep -v '^D'|rev|cut -f1|rev| xargs ./v fmt -noerror -diff
- name: Run v test-fmt
run: ./v test-fmt

View File

@ -1,4 +1,4 @@
import http
import net.http
fn main() {
html := http.get_text('https://news.ycombinator.com')

View File

@ -1,7 +1,7 @@
// Copyright (c) 2019 Alexander Medvednikov. All rights reserved.
// Use of this source code is governed by an MIT license
// that can be found in the LICENSE file.
import http
import net.http
import json
import sync

View File

@ -19,6 +19,7 @@ struct FormatOptions {
is_all bool
is_worker bool
is_debug bool
is_noerror bool
}
const (
@ -44,6 +45,7 @@ fn main() {
is_all: '-all' in args || '--all' in args
is_worker: '-worker' in args
is_debug: '-debug' in args
is_noerror: '-noerror' in args
}
if foptions.is_verbose {
eprintln('vfmt foptions: $foptions')
@ -104,6 +106,9 @@ fn main() {
}
if errors > 0 {
eprintln('Encountered a total of: ${errors} errors.')
if foptions.is_noerror {
exit(0)
}
exit(1)
}
}

View File

@ -1,7 +1,7 @@
module main
import (
http
net.http
os
json
filepath

View File

@ -6,7 +6,7 @@ module http
import os
pub fn download_file(url, out string) bool {
s := http.get(url) or {
s := get(url) or {
return false
}
os.write_file(out, s.text)

View File

@ -4,7 +4,7 @@
module http
import net.urllib
import http.chunked
import net.http.chunked
const (
max_redirects = 4

View File

@ -1,5 +1,5 @@
// import net.urllib
import http
import net.http
fn test_escape_unescape() {
/*

View File

@ -7,7 +7,7 @@ module vweb
import (
os
net
http
net.http
net.urllib
strings
)