Skip to content

1500256797/go-crypto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go VS Rust

通过对比 Go 和 Rust 的语法,来学习 Go 语言

创建模块

模块初始化 如果你熟悉 Rust 的 cargo 工具,可以将 Go 的初始化流程理解为以下步骤:

cargo init → mkdir && cd && go mod init 创建 main.rs → 创建 main.go cargo run → go run main.go cargo add → go get cargo build → go build cargo test → go test

多模块管理

项目结构

~/Desktop/go-crypto tree -L 2 --gitignore
.
├── eth
│   └── go.mod
├── go.mod
├── go.work
├── images
│   └── go-mod-init.png
├── main.go
├── README.md
├── shared_lib
│   ├── go.mod
│   └── utils.go
└── sol
    └── go.mod

参考文档: https://go.dev/doc/tutorial/workspaces

Rust和Go的Wokspace

单元测试

go 的单元测试时内置的,且有一定的工程约定,比较简单。

go单元测试

About

用Rust的方式学习go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages