Comments (4)
下面是Go语言的FAQ
- 能否关闭对未使用的包引入或变量的警告?参考官方解答 肯定是不推荐关闭的
- 其他编程语言中有
defer
关键字吗?defer
关键字由go语言首先发明,本来用于解决panic的恢复,比如defer mu.Unlock()
防止死锁 - 为何要把类型申明放到变量的后面,而不学C族语法?参考官方解答其实弱类型语言好像有将类型放后面的趋势(比如遵守ES标准的ActionScript),这样可以先var再说明具体类型嘛
- 为何不使用类似C++/Java的类来实现OOP?模型更像smalltalk,相比C++/Java更加轻量级减少侵入,参考Google I/O 2010演讲
- 为何struct多行定义要求使用分号分行?防止出现JS里面关于分号的复杂处理,Go语言里面直接隐式在每行末尾添加分号
- 为何列表list定义方法不一致,有些有逗号,有些又没有?原因基本上面已经回答了,那些没逗号的其实需要分号,而分号是可以隐式添加的
- 为何使用
for
实现while功能?其实不需要相同功能的关键字 - 为何特别关注并发和协程?使用channel和轻量级协程比线程更有效参考之前的试验
如果已经可以轻松回答下列问题,那么你只需要完成之后的Go语言编程作业就可以了:在线练习中要求实现Crawler和简单KV
答案在 #3
:=
和=
的区别? 前者a:=3
是变量声明var a int = 3
的缩写- range如何使用?仅配合slice或map遍历使用,
for k, v := range SLICE_OR_MAP
,注意默认是k,只取v得使用_, v
- make如何使用?用于创建slice或map,
make(map[k]v)
,这些结构的初始化都使用{} - 函数可以作为变量?是的,可以作为函数形参,也可以直接赋予给变量,函数还支持闭包
- 如何使用接口?
type NAME interface { FUN() RET_VAL }
,结构实现相同函数即可,进行赋值 - 如何创建通道?使用
c := make(chan int)
,可以配合select
与case <-
关键字使用
from mit-6.824.
练习做完后可以看此链接
from mit-6.824.
请问这个lab0的内容在哪里可以找到啊?
from mit-6.824.
请问这个lab0的内容在哪里可以找到啊?
http://nil.csail.mit.edu/6.824/2020/schedule.html
from mit-6.824.
Related Issues (11)
- MIT6.824分布式系统欢迎你 HOT 5
- Lec 6:Raft实现 HOT 7
- 【错误提示】MIT-6.824/src/raft/raft.go 中import "labrpc"失败 HOT 2
- 求建新的群 HOT 5
- cannot find module providing package 6.824/diskv 6.824/lockservice: 6.824/pbservice: 6.824/viewservice:
- Lec1:入门介绍(以MapReduce为例) HOT 3
- Lec2:RPC与线程机制(Go语言实战) HOT 5
- Lec3:GFS HOT 3
- Lec 4:主从备份 HOT 1
- Lec 5:Raft基本 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mit-6.824.