Skip to content

Instantly share code, notes, and snippets.

@nickpresta
nickpresta / math.go
Last active December 17, 2015 13:09 — forked from mwarkentin/math.go
package math
import (
"errors"
m "math"
)
// Finds the minimum value in a slice of numbers
func Min(xs []float64) (float64, error) {
if len(xs) == 0 {

Why I Like Go

I visited with PagerDuty yesterday for a little Friday beer and pizza. While there I got started talking about Go. I was asked by Alex, their CEO, why I liked it. Several other people have asked me the same question recently, so I figured it was worth posting.

Goroutines

The first 1/2 of Go's concurrency story. Lightweight, concurrent function execution. You can spawn tons of these if needed and the Go runtime multiplexes them onto the configured number of CPUs/Threads as needed. They start with a super small stack that can grow (and shrink) via dynamic allocation (and freeing). They are as simple as go f(x), where f() is a function.

Channels