mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
compiler: error on unused imports
This commit is contained in:
committed by
Alexander Medvednikov
parent
71484e89d6
commit
23c84516e2
@@ -1,5 +1,3 @@
|
||||
import os
|
||||
|
||||
const (
|
||||
q = [1, 2, 3]
|
||||
A = 8
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import time
|
||||
// import time
|
||||
|
||||
struct User {
|
||||
name string
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
module aes
|
||||
|
||||
import (
|
||||
crypto.cipher
|
||||
crypto.internal.subtle
|
||||
)
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ fn _new_cbc(b AesCipher, iv []byte) AesCbc {
|
||||
b: b,
|
||||
block_size: b.block_size(),
|
||||
iv: iv.clone(),
|
||||
tmp: [byte(0); b.block_size()],
|
||||
tmp: [byte(0)].repeat(b.block_size()),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
module aes
|
||||
|
||||
import (
|
||||
crypto.cipher
|
||||
crypto.internal.subtle
|
||||
// crypto.cipher
|
||||
// crypto.internal.subtle
|
||||
)
|
||||
|
||||
// new_cipher_generic creates and returns a new cipher.Block
|
||||
|
||||
@@ -8,7 +8,6 @@ import (
|
||||
os
|
||||
gx
|
||||
gg
|
||||
stbi
|
||||
glm
|
||||
gl
|
||||
)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
module gl
|
||||
|
||||
import os
|
||||
// import os
|
||||
import gx
|
||||
import glm
|
||||
|
||||
|
||||
@@ -8,6 +8,9 @@ module gl
|
||||
#include "glad.h"
|
||||
#flag @VROOT/thirdparty/glad/glad.o
|
||||
|
||||
// joe-c: fix & remove
|
||||
enum TmpGlImportHack{}
|
||||
|
||||
pub fn init_glad() {
|
||||
ok := C.gladLoadGL()
|
||||
if isnil(ok) {
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
module glfw
|
||||
|
||||
// note: we might need special case for this
|
||||
// see TmpGlImportHack below (joe-c)
|
||||
import gl
|
||||
|
||||
#flag -I @VROOT/thirdparty/glfw
|
||||
@@ -41,6 +43,11 @@ const (
|
||||
KeyDown = 264
|
||||
)
|
||||
|
||||
// joe-c: fix & remove
|
||||
struct TmpGlImportHack {
|
||||
hack gl.TmpGlImportHack
|
||||
}
|
||||
|
||||
struct WinCfg {
|
||||
width int
|
||||
height int
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Use of this source code is governed by an MIT license
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
import os
|
||||
import gl
|
||||
// might need special case for this
|
||||
// import gl
|
||||
import glm
|
||||
|
||||
fn cmp(a, b f32) bool {
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
|
||||
module http
|
||||
|
||||
import os
|
||||
|
||||
type downloadfn fn (written int)
|
||||
type download_finished_fn fn ()
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import net.urllib
|
||||
import http
|
||||
// import net.urllib
|
||||
// import http
|
||||
|
||||
fn test_escape_unescape() {
|
||||
/*
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
|
||||
module stbi
|
||||
|
||||
import gl
|
||||
// note we might need special case for this
|
||||
// import gl
|
||||
|
||||
#flag -I @VROOT/thirdparty/stb_image
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
module sync
|
||||
import os
|
||||
|
||||
// Mutex HANDLE
|
||||
type MHANDLE voidptr
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
|
||||
module term
|
||||
|
||||
import os
|
||||
|
||||
fn _format(msg, open, close string) string {
|
||||
return '\x1b[' + open + 'm' + msg + '\x1b[' + close + 'm'
|
||||
}
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
|
||||
module term
|
||||
|
||||
import os
|
||||
|
||||
pub fn format(msg, open, close string) string {
|
||||
return _format(msg, open, close)
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ module vweb
|
||||
|
||||
import (
|
||||
os
|
||||
strings
|
||||
net
|
||||
http
|
||||
net.urllib
|
||||
|
||||
Reference in New Issue
Block a user