Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
1
Task/Variables/Go/variables-1.go
Normal file
1
Task/Variables/Go/variables-1.go
Normal file
|
|
@ -0,0 +1 @@
|
|||
x := 3
|
||||
2
Task/Variables/Go/variables-2.go
Normal file
2
Task/Variables/Go/variables-2.go
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
var x int // declaration
|
||||
x = 3 // assignment
|
||||
4
Task/Variables/Go/variables-3.go
Normal file
4
Task/Variables/Go/variables-3.go
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
y := x+1 // y is int, assuming declaration above
|
||||
same := x == y // same declared as bool
|
||||
p := &same // type of p is pointer to bool
|
||||
pi := math.Floor(math.Pi) // math.Floor returns float64, so that is the type of pi
|
||||
2
Task/Variables/Go/variables-4.go
Normal file
2
Task/Variables/Go/variables-4.go
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
var x, y int // two variables, initialized to zero.
|
||||
var p *int // initialized to nil
|
||||
4
Task/Variables/Go/variables-5.go
Normal file
4
Task/Variables/Go/variables-5.go
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
var (
|
||||
x, y int
|
||||
s string
|
||||
)
|
||||
4
Task/Variables/Go/variables-6.go
Normal file
4
Task/Variables/Go/variables-6.go
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
x, y = y, x // swap x and y
|
||||
sinX, cosX = math.Sincos(x) // Sincos function returns two values
|
||||
// map lookup optionally returns a second value indicating if the key was found.
|
||||
value, ok = mapObject[key]
|
||||
5
Task/Variables/Go/variables-7.go
Normal file
5
Task/Variables/Go/variables-7.go
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
func increase (x int) (more int) {
|
||||
x++
|
||||
more = x+x
|
||||
return
|
||||
}
|
||||
1
Task/Variables/Go/variables-8.go
Normal file
1
Task/Variables/Go/variables-8.go
Normal file
|
|
@ -0,0 +1 @@
|
|||
x, y := 3, 4
|
||||
Loading…
Add table
Add a link
Reference in a new issue