Rust、Go
更新时间:2023-12-31
Rust安装
sh
export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static
export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup
sh
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
rustc --version
rustup update
- 新建项目和添加依赖
sh
cargo new dir --name demo #--lib or --bin
cargo add slint #--target
cargo add slint-build --build
cargo add rusqlite --features "bundled"
cargo update -p clap --precise 3.2.23
cargo remove slint #del pkg
Rust编译
sh
cargo build
cargo check
交叉编译
sh
cargo install cross #need install gcc docker
cross build --target aarch64-linux-android --release
Go环境
sh
go env -w GO111MODULE=on GOPROXY=https://mirrors.aliyun.com/goproxy/,direct GONOSUMDB=* # GO ???`