Show Menu
Cheatography

CSI2520 Cheat Sheet Cheat Sheet (DRAFT) by

Cheat sheet for CSI2520

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Golang

Types
- int, int8, int16, int32
- byte, uint, uint16, uint32, uint64
- float32, float64
- complex, complex64, complex128
- bool
- String
- pointers

Les variables et fonctions en Go

package main

import (
	"fmt"
	//"sync", etc
)

const pi = 3.1416 // declaration du type optionnel: const pi float= 3.1416
var x int = 5 //variable globale

func main() {
	var ( // declaration en groupe
		a float64 = 8.8
		b flat 64
	)
	b= fonction(a)
	fmt.Printf("valeur: %f", b)
}

func fonction(z float64) float32 {
	u := 3.3 //declaration initialisee
	return u*z
}

Les variables et fonctions en Go

package main

import (
	"fmt"
	//"sync", etc
)

const pi = 3.1416 // declaration du type optionnel: const pi float= 3.1416
var x int = 5 //variable globale

func main() {
	var ( // declaration en groupe
		a float64 = 8.8
		b flat 64
	)
	b= fonction(a)
	fmt.Printf("valeur: %f", b)
}

func fonction(z float64) float32 {
	u := 3.3 //declaration initialisee
	return u*z
}