Skip to content

Instantly share code, notes, and snippets.

View go-loco's full-sized avatar

Hernán Di Chello go-loco

View GitHub Profile
@go-loco
go-loco / gorotouine.go
Last active May 3, 2016 19:45
gorotouine.go
package main
import (
"fmt"
"math/rand"
"time"
)
func main() {
go boring("boring!")
@go-loco
go-loco / .go
Last active May 3, 2016 19:35
channels.go
package main
import "fmt"
var messages = make(chan string)
func main() {
go func() {
messages <- "ping"
@go-loco
go-loco / onemillion.go
Last active May 3, 2016 11:05
One million go routines
package main
import (
"fmt"
"time"
)
var jobs = make(chan int)
var done = make(chan bool)
var counter = make(chan bool)
@go-loco
go-loco / .go
Last active April 5, 2016 02:42
Web Server Hola Mundo
package main
import (
"fmt"
"net/http"
)
func main() {
server := &http.Server{
@go-loco
go-loco / maxidle_test.go
Created March 27, 2016 13:05
Modifying dynamically MaxIdleConnsPerHost on http.Transport creates a data race
package main
import (
"fmt"
"io/ioutil"
"math/rand"
"net/http"
"net/http/httptest"
"sync"
"testing"
@go-loco
go-loco / .go
Last active April 4, 2016 19:05
Go Hola Mundo
package main
func main() {
println("Hola mundo!")
}