Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1 @@
x := 3

View file

@ -0,0 +1,2 @@
var x int // declaration
x = 3 // assignment

View 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

View file

@ -0,0 +1,2 @@
var x, y int // two variables, initialized to zero.
var p *int // initialized to nil

View file

@ -0,0 +1,4 @@
var (
x, y int
s string
)

View 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]

View file

@ -0,0 +1,5 @@
func increase (x int) (more int) {
x++
more = x+x
return
}

View file

@ -0,0 +1 @@
x, y := 3, 4