Skip to content

Instantly share code, notes, and snippets.

View davidsnt's full-sized avatar

David Santhosh davidsnt

View GitHub Profile
package main
import (
"fmt"
"math/rand"
"sync/atomic"
"time"
)
// In this example our state will be owned by a single
// Simple example of sending multiple values on a channel of a custom type
package main
import (
"fmt"
)
type num struct {
Num int
@davidsnt
davidsnt / gomaps.go
Last active August 23, 2017 21:02
Golang Maps
package main
import (
"fmt"
)
func main() {
numMap := map[string][]int{}
for i := 0; i <= 10; i++ {
numMap["numbers"] = append(numMap["numbers"], i)
}
fmt.Println(numMap)