move http module to net.http
parent
6cee50afda
commit
63b70ddb06
|
@ -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
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import http
|
||||
import net.http
|
||||
|
||||
fn main() {
|
||||
html := http.get_text('https://news.ycombinator.com')
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
module main
|
||||
|
||||
import (
|
||||
http
|
||||
net.http
|
||||
os
|
||||
json
|
||||
filepath
|
||||
|
|
|
@ -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)
|
|
@ -4,7 +4,7 @@
|
|||
module http
|
||||
|
||||
import net.urllib
|
||||
import http.chunked
|
||||
import net.http.chunked
|
||||
|
||||
const (
|
||||
max_redirects = 4
|
|
@ -1,5 +1,5 @@
|
|||
// import net.urllib
|
||||
import http
|
||||
import net.http
|
||||
|
||||
fn test_escape_unescape() {
|
||||
/*
|
|
@ -7,7 +7,7 @@ module vweb
|
|||
import (
|
||||
os
|
||||
net
|
||||
http
|
||||
net.http
|
||||
net.urllib
|
||||
strings
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue