-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Golang #20
Labels
Comments
Basics-1
var x int
var p *int
var a [3]int
f func(func(int,int) int, int) func(int, int) int
func add(x, y int) int {
return x + y
}
func swap(x, y string) (string, string) {
return y, x
}
func main() {
a, b := swap("hello", "world")
fmt.Println(a, b)
}
func split(sum int) (x, y int) {
x = sum * 4 / 9
y = sum - x
return
// return 1,2
} var i, j int = 1, 2
var c, python, java = true, false, "no!"
var i, j int = 1, 2
k := 3
c, python, java := true, false, "no!"
var f float64 = math.Sqrt(float64(16 + 9))
var z uint = uint(f) |
Basic-2sum := 0
for i := 0; i < 10; i++ {
sum += i
}
fmt.Println(sum)
if x < 0 {
return sqrt(-x) + "i"
}
if v := math.Pow(x, n); v < lim {
return v
}
func main() {
fmt.Println("counting")
for i := 0; i < 10; i++ {
defer fmt.Println(i)
}
fmt.Println("done")
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
特性详见 官方教程 && 本文概要其特性 -> 相当于目录
The text was updated successfully, but these errors were encountered: