accounts/abi: on windows,empty filename always generate error:

"Failed to generate ABI binding: The filename, directory name, or volume label syntax is incorrect."
    because package imports need to get filename's path.
This commit is contained in:
nkbai 2017-09-01 16:37:26 +08:00
parent d70536b5d4
commit d2735955d9

View file

@ -122,7 +122,7 @@ func Bind(types []string, abis []string, bytecodes []string, pkg string, lang La
} }
// For Go bindings pass the code through goimports to clean it up and double check // For Go bindings pass the code through goimports to clean it up and double check
if lang == LangGo { if lang == LangGo {
code, err := imports.Process("", buffer.Bytes(), nil) code, err := imports.Process(".", buffer.Bytes(), nil)
if err != nil { if err != nil {
return "", fmt.Errorf("%v\n%s", err, buffer) return "", fmt.Errorf("%v\n%s", err, buffer)
} }