golang

package yetAnotherNewFunc

import ( "fmt" "reflect" "sync" "testing" ) type Foo struct{} func NewFoo() *Foo { return &Foo{} } func YieldFoo() Foo { return Foo{} } func SpawnFoo(F func(interface{}) error) chan Foo { chFoo := make(chan Foo) go func() { for { x := <-ch…

ブロ名を変えてみた。

Hello, test!

Hello, this blog post from command line on\

hatepo

hatepo

fizzbuzz with 'knock group'

package main import ( "flag" "fmt" "io" "net/http" "strconv" "sync" ) var ( vol = flag.Int("v", 100, "volume") max = flag.Int("m", 10000, "send numbers") ) type msg struct { Q int A int I interface{} } type comm struct { Sch chan msg Rch c…

fizzbuzz timer

package main import ( "context" "fmt" "time" ) const ( FIZZBUZZ = iota FIZZ BUZZ NOTFIZZBUZZ ) type result byte func (r result) String() string { if r&(1<<FIZZBUZZ) > 0 { return "fizzbuzz" } if r&(1<<FIZZ) > 0 { return "fizz" } if r&(1<<BUZZ) > 0 { return "buzz" } if</buzz)></fizz)></fizzbuzz)>…

Goのloop

loopのvariable for _, v := range items { v := v go func(){ process(v) }() } for _, v := range items { go func(v type) { process(v) }(v) } loopとwait group var wg sync.WaitGroup for _, v := range items { v := v wg.Add(1) go func(){ process(…

ここ2~3日の(気になるリンク

テスト http://www.slideshare.net/takuyaueda967/go-53217449 ライブラリ http://www.mjhall.org/articles/golang-libraries.html スライス http://mattn.kaoriya.net/software/lang/go/20150928144704.htm 高速化 http://qiita.com/y_matsuwitter/items/77…

runtime: out of memory: cannot allocate 1073741824-byte block (1074790400 in use)

fatal error: out of memory http://blog.davidsingleton.org/parsing-huge-xml-files-with-go/

memoMemo built-in dataStructures

string(2 words), slice(3 words), interface(2 words), map(1 word), chan(1 word), func(1 word)

microBlogHello!

MemoMemo ‘Jun Kuroda - Snow Cone[FREE DL(MIDI&SONG)]’ on #SoundCloud? #gramsMyNinja #np https://t.co/onSKaTduyu

MemoMemo CORS

https://en.wikipedia.org/wiki/Cross-origin_resource_sharing

Hello, World!

My staple food is golang. Blog post from cmdline. This post is just test.