Created
November 9, 2016 21:04
-
-
Save pitakill/804bbc7066b70cb43847a5cfff07763b 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
# Packages | |
Todos los programas corren package main | |
Se pueden nombrar paquetes con otros nombres pero no corren solos | |
# Imports | |
Multiples líneas | |
Agrupados | |
# Exported names | |
Lo que se quiere exportar tiene que tener mayúscula al principio | |
# Functions | |
Uno o varios argumentos | |
# Functions (return: Multiple, naked) | |
Una función puede regresar varias cosas | |
Una función puede regresar un valor ya nombrado | |
# Variables (initializer, short assignment) | |
Todas las variables son tipadas, implicitamente pero tipadas | |
Variables implícitas solo dentro de funciones | |
# Types | |
bool | |
string | |
in int8 int16 int32 int64 | |
unit unit8 unit16 unit32 unit64 unitptr | |
byte // unit8 | |
rune // int32 | |
float32 float64 | |
complex64 complex128 | |
#Type convertion | |
var x, y int = 3, 4 | |
var f float64 = math.Sqrt(float64(x*x + y*y)) | |
var z uint = uint(f) | |
fmt.Println(x, y, z) | |
# Const | |
String, boolean, números y son inicializadas de manera larga | |
# Defer | |
# Pointers |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment