I'm not entirely sure this is an issue, or my wrong understanding on how to use the library.
When i call Update(time.Now(),1234) i get a panic:
panic: runtime error: cgo argument has Go pointer to Go pointer
Here's a snippet of my code:
u := rrd.NewUpdater(fname)
tstamp, ok := time.Parse("2006-01-02 03:04:05.000000", timestamp)
if ok != nil {
Info.Println("Error parsing timestamp \"" + timestamp + "\"")
tstamp = time.Now()
}
u.SetTemplate("a")
err := u.Update(tstamp,reading)
if err != nil {
Error.Println(err)
}
I've verified that the filename used to initialize the call to NewUpdater is in fact a string (and correct), and the types of the parameters in the call are time.Time and float64.
it appears to happen in the following code (src/github.com/ziutek/rrd/rrd_c.go:69 +0x100
github.com/ziutek/rrd.(*Updater).Update(0xc820129c38, 0x0, 0x0, 0x0, 0x0, 0x0))
func (u *Updater) update(args []unsafe.Pointer) error {
e := C.rrdUpdate(
(*C.char)(u.filename.p()),
(*C.char)(u.template.p()),
C.int(len(args)),
(**C.char)(unsafe.Pointer(&args[0])),
)
return makeError(e)
}