Skip to main content

Posts

Featured

DAY 3 - #100 DAYS OF GO/CLOUD

Today, I completed some Progate Go Study II lessons and had to write a randomizer that uses the time package together with math/rand to give different random number for an Intn.
Also played around loops, Go doesn't use () in it's for declarations.
Here's the code

package main import "fmt" // Import the "math/rand" and "time" packages import "math/rand" import "time" func main() { // Seed the random number generator rand.Seed(time.Now().Unix()) // Add a for loop for i := 1; i <= 3; i++ { fmt.Printf("Fortune number %d: ", i) number := rand.Intn(6) switch number { case 0: fmt.Println("Unlucky") case 1, 2: fmt.Println("A little lucky") case 3, 4: fmt.Println("Lucky") case 5: fmt.Println("Very lucky") } …

Latest posts

DAY 2 - #100 DAYS OF GO/CLOUD

Day 1 - #100 Days of Go/Cloud

Connecting to Cloud SQL from VM Instances on Google Cloud Platform

Full Text Search in Django

Apache Proxy Snippet for Exposing API on Sub-domain

Installing and Connecting to Multiple Versions of PostgreSQL on a Linux Machine

Heplful Docker Commands

How To Set Up Django with Postgres, Nginx, and Gunicorn on Ubuntu 18.04