Skip to content

Using loadFile #1

Description

@anpic

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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions