code: func (e *encoder) Encode(i interface{}) {
  	if e == nil || e.w == nil {
  		return
  	}
  	e.Lock()
  	defer e.Unlock()
  
  	js, err := json.Marshal(i)
  	if err != nil {
  		log.Println("[ERROR] dag:", err)
  		return
  	}
  	js = append(js, '\n')
  
  	_, err = e.w.Write(js)
  	if err != nil {
  		log.Println("[ERROR] dag:", err)
  		return
  	}
  }
docs: // Encode is analogous to json.Encoder.Encode