-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
golang面試題整理
- unbuffered vs buffered channel
- make 與 new 的差別
- rune vs byte
- type assertion
- 使用 slice of pointers 或 slice of structs
常規性Golang面試題解析
Go 實現常用設計模式
Go 易錯面試題彙總 (code)
type assertion
event, err := New(0)
if err != nil {
t.Error(err)
}
_, ok := event.(Like)
if !ok {
t.Error("Assertion error")
}sync
- sync.Mutex
- sync.RWMutex
- sync.WaitGroup
- sync.Once
- sync.Map
- sync.Pool
- sync.Cond
匿名函數語閉包
var foo = func() func() {
var i int
return func() {
i++
fmt.Println(i)
}
}()
foo() // 1
foo() // 2
foo() // 3Go semaphore
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels