/images/avatar.svg

谷中仁的博客

所有文章观点仅代表本站观点,与他人无关。

Cargo 运行出错及解决方案

问题 1 2 3 4 5 6 7 ❯ cargo run error: failed to run `rustc` to learn about target-specific information Caused by: process didn't exit successfully: `rustc - --crate-name ___ --print=file-names -Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit code: 1) --- stderr error: the option `Z` is only accepted on the nightly compiler`

Go Import 相关操作

go 的 import 其实是去 GOROOT 下去加载你写的模块,当然 Go 的 import 还支持如下两种方式来加载自己写的模块: 相对路径 1 import "./model" //当前文件同一目录的 model 目录,但是不建议这