From 7dce3d8967c277080425624dc90077be5a0bc16a Mon Sep 17 00:00:00 2001 From: san Date: Sat, 3 Nov 2018 09:12:25 +0800 Subject: [PATCH] fixed import "C" --- parser/imports.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/parser/imports.go b/parser/imports.go index d0edd15..06a48e6 100644 --- a/parser/imports.go +++ b/parser/imports.go @@ -29,7 +29,10 @@ func addImports(imports map[string]string, decl ast.Decl, srcDir string) { continue } } - quotedPath := importSpec.Path.Value // e.g. "\"sample/app/models\"" + quotedPath := importSpec.Path.Value // e.g. "\"sample/app/models\"" + if quotedPath == `"C"` { + continue + } fullPath := quotedPath[1 : len(quotedPath)-1] // Remove the quotes // If the package was not aliased (common case), we have to import it