Toggle navigation
New
Learn
Snippets
Meta
News
About
API Docs
Source Code
Account
Register
Login
Untitled
main.go
dio.go
✖
tria.go
✖
tessera.go
✖
pente.go
✖
eksi.go
✖
Run Settings
Language
Go
Language Version
latest
Run Command
Snippet Metadata
Owner
w3xue
Created
Modified
Visibility
Public
package main import "fmt" func main() { // 这里我们定义了一个可以存储整数类型的带缓冲通道 // 缓冲区大小为2 ch := make(chan int, 2) // 因为 ch 是带缓冲的通道,我们可以同时发送两个数据 // 而不用立刻需要去同步读取数据 ch <- 1 ch <- 2 // 获取这两个数据 fmt.Println(<-ch) fmt.Println(<-ch) }
Editor Settings
Theme
Chrome
Clouds
Crimson Editor
Dawn
Dreamweaver
Eclipse
GitHub
Solarized Light
TextMate
Tomorrow
XCode
Kuroir
KatzenMilch
Ambiance
Chaos
Clouds Midnight
Cobalt
idle Fingers
krTheme
Merbivore
Merbivore Soft
Mono Industrial
Monokai
Pastel on dark
Solarized Dark
Terminal
Tomorrow Night
Tomorrow Night Blue
Tomorrow Night Bright
Tomorrow Night 80s
Twilight
Vibrant Ink
Key bindings
Default
Vim
Emacs
Full width
True
False
Lines
-
Auto
+
Direct link
Raw
Embed