1. binet
  2. go-hepevt

Commits

Sebastien Binet  committed dcf0e00

abstract away from json

  • Participants
  • Parent commits ebd168d
  • Branches default

Comments (0)

Files changed (1)

File pkg/hepevt_io.go

View file
 import "C"
 
 import (
-	"json"
+	"os"
 )
 
 // I/O ----------------------------------------------------------------------
 	Vhep   [][4]float64
 }
 
-func WriteTo(enc *json.Encoder) {
+type Encoder interface {
+	Encode(v interface{}) os.Error
+}
+
+func WriteTo(enc Encoder) {
 	evt := event{Nevhep: EventNumber(),	Nhep: NumberEntries()}
 	evt.Isthep = make([]int, evt.Nhep)
 	evt.Idhep  = make([]int, evt.Nhep)