Replace Ruby code by Go-lang