本格的に復号していく前に、デコーダのインタフェースと補助関数を作る。既にちょっとコードに書いているけど。 外部インタフェース 外部インタフェースは一旦こういう感じで。出力はまだどういう形式にするか考えていないので一旦無し。 import ( "bufio" "io" ) type Decoder struct { r *bufio.Reader } func NewDecoder(r io.Reader) *Decoder { return &Decoder{ r: bufio.NewReader(r), } } func (d *Decoder) Decode() error { // TO…