You have the function loadFile definition in your code
var loadFile func(slotNum int, fp string) int32
purego.RegisterLibFunc(&loadFile, lib, "sv_load")
But there is no use for it. It's better to rewrite the function LoadFileFromPath like this
func (s *SunvoxChannel) LoadFileFromPath(filepath string) error {
loaded := loadFile(s.Index, filepath)
if loaded != 0 {
return errors.New(fmt.Sprintf("error loading sunvox data: %d", loaded))
}
s.filename = filepath
return nil
}
You have the function
loadFiledefinition in your codevar loadFile func(slotNum int, fp string) int32purego.RegisterLibFunc(&loadFile, lib, "sv_load")But there is no use for it. It's better to rewrite the function
LoadFileFromPathlike this