design pattern in Go