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

vweb: fix typo in 'assets.v'

This commit is contained in:
Major Taylor 2020-02-07 17:12:30 -05:00 committed by GitHub
parent 8f9979eb8d
commit e9827f5a34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -87,7 +87,7 @@ fn (am mut AssetManager) combine(asset_type string, to_file bool) string {
}
// rebuild
for asset in am.get_assets(asset_type) {
mut data := os.read_file(asset.file_path) or {
data := os.read_file(asset.file_path) or {
return ''
}
out += data
@ -118,8 +118,8 @@ fn (am mut AssetManager) get_cache_key(asset_type string) string {
mut latest_modified := 0
for asset in am.get_assets(asset_type) {
files_salt += asset.file_path
if asset.last_modified.uni > latest_modified {
latest_modified = asset.last_modified.uni
if asset.last_modified.unix > latest_modified {
latest_modified = asset.last_modified.unix
}
}
hash := md5.sum(files_salt.bytes()).hex()
@ -159,7 +159,7 @@ fn (am mut AssetManager) add(asset_type, file string) bool {
}
asset := Asset{
file_path: file
last_modified: time.Time{uni: os.file_last_mod_unix(file)}
last_modified: time.Time{unix: os.file_last_mod_unix(file)}
}
if asset_type == 'css' {
am.css << asset