Created
May 24, 2020 01:48
-
-
Save daniel7byte/12d581cf8af6637e5fcabeea2532ec92 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
// func main() { | |
// Comienza con mayúscula EXPORTADO | |
// minuscula NO EXPORTADO | |
// fmt.Println("Hello, playground") | |
// fmt.Println(rand.Intn(100)) | |
// Saludar("Jose", "Posso") | |
// } | |
// func Saludar(nombre, apellido string) { //nombre string, apellido string | |
// fmt.Println("Hola", nombre, apellido) | |
// } | |
func main() { | |
// TEST # 0 | |
// var data int // Se inicializa en 0 | |
// data = 10 | |
// var data = 10 | |
// shortcut | |
// data := 10 // NO se inicializa en 0 | |
// duck typing | |
// TEST #1 | |
// var data int | |
// data = 10 | |
// data := 11 // no new variables on left side of := | |
// data = 9 | |
// TEST #2 | |
// var a int | |
// var b int32 | |
// a = 10 | |
// b = 15 | |
// data := a + int(b) | |
// fmt.Println(data) | |
// fmt.Printf("%T", data) | |
// TEST #3 | |
// for | |
// for i := 0; i < 10; i++ { | |
// fmt.Println(i) | |
// } | |
// while | |
// i := 0 | |
// for i < 10 { | |
// fmt.Println(i) | |
// i++ | |
// } | |
// forever | |
// for { | |
// break | |
// } | |
// TEST #4 | |
if i := 1; i < 10 { | |
fmt.Println(true) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment