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" ) /* 定义函数 */ type Circle struct { radius float64 } func main() { var c1 Circle c1.radius = 10.00 fmt.Println("Area of Circle(c1) = ", c1.getArea()) } //该 method 属于 Circle 类型对象中的方法 func (c Circle) getArea() float64 { //c.radius 即为 Circle 类型对象中的属性 return 3.14 * c.radius * c.radius }
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