mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
all: updateimport () and []array
This commit is contained in:
@@ -3,11 +3,9 @@ module assets
|
||||
// this module provides an AssetManager for combining
|
||||
// and caching javascript & css.
|
||||
|
||||
import (
|
||||
os
|
||||
time
|
||||
crypto.md5
|
||||
)
|
||||
import os
|
||||
import time
|
||||
import crypto.md5
|
||||
|
||||
const (
|
||||
UnknownAssetTypeError = 'vweb.assets: unknown asset type'
|
||||
@@ -21,7 +19,7 @@ pub mut:
|
||||
// when true assets will be minified
|
||||
minify bool
|
||||
// the directory to store the cached/combined files
|
||||
cache_dir string
|
||||
cache_dir string
|
||||
}
|
||||
|
||||
struct Asset {
|
||||
@@ -75,11 +73,11 @@ fn (am AssetManager) combine(asset_type string, to_file bool) string {
|
||||
cache_key := am.get_cache_key(asset_type)
|
||||
out_file := '$am.cache_dir/${cache_key}.$asset_type'
|
||||
mut out := ''
|
||||
// use cache
|
||||
// use cache
|
||||
if os.exists(out_file) {
|
||||
if to_file {
|
||||
return out_file
|
||||
}
|
||||
}
|
||||
cached := os.read_file(out_file) or {
|
||||
return ''
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import (
|
||||
vweb.assets
|
||||
os
|
||||
)
|
||||
import vweb.assets
|
||||
import os
|
||||
|
||||
// clean_cache_dir used before and after tests that write to a cache directory.
|
||||
// Because of parallel compilation and therefore test running,
|
||||
|
||||
@@ -4,13 +4,11 @@
|
||||
|
||||
module vweb
|
||||
|
||||
import (
|
||||
os
|
||||
net
|
||||
net.http
|
||||
net.urllib
|
||||
strings
|
||||
)
|
||||
import os
|
||||
import net
|
||||
import net.http
|
||||
import net.urllib
|
||||
import strings
|
||||
|
||||
pub const (
|
||||
methods_with_form = ['POST', 'PUT', 'PATCH']
|
||||
@@ -186,7 +184,7 @@ fn handle_conn<T>(conn net.Socket, app mut T) {
|
||||
return
|
||||
//continue
|
||||
}
|
||||
mut headers := []string
|
||||
mut headers := []string{}
|
||||
mut body := ''
|
||||
mut in_headers := true
|
||||
mut len := 0
|
||||
|
||||
Reference in New Issue
Block a user