Golang – How to generate a random integer

Small script to generate a random integer, between 1 and 100, in Golang, the Google programming language. package main import ( “fmt” “math/rand” “time” ) func random(min, max int) int { rand.Seed(time.Now().UTC().UnixNano()) return rand.Intn(max-min) +…

Golang – Get Cookies in Revel

package controllers import ( “github.com/revel/revel” “fmt” ) type App struct { *revel.Controller } func MyController(c App ) *Utente { cookies := c.Request.Cookies() for _, cookie := range cookies { if cookie.Name == “mycookie” { cookieValue…