generations: update

vscode: settings.json
devices: close file with function
mini 3 years ago
parent 2b9161a874
commit ce853a74ab

@ -0,0 +1,5 @@
{
"gopls": {
"build.buildFlags": ["xdr"]
}
}

@ -31,6 +31,7 @@ func LoadKeymap(file io.ReadCloser, dev *DeviceDef) *KeyMap {
mapped.Keymap = make([]uint16, dev.NumKeys)
binary.Read(file, binary.LittleEndian, mapped.Keymap)
binary.Read(file, binary.LittleEndian, mapped.Color)
file.Close()
return mapped
}

@ -29,10 +29,11 @@ func init() {
func LoadKeymap(file io.ReadCloser, dev *DeviceDef) *KeyMap {
mapped := new(KeyMap)
xdr.Unmarshal(file, mapped)
file.Close()
return mapped
}
//SavePKMKeymap saves an orb after edit
//SaveKeymap Save Orbmap KM struction
func SaveKeymap(file io.WriteCloser, mapped interface{}) {
xdr.Marshal(file, mapped)
file.Close()

Binary file not shown.

@ -2,4 +2,4 @@ module github.com/OrbTools/OrbCommon
go 1.16
require github.com/davecgh/go-xdr v0.0.0-20161123171359-e6a2ba005892 // indirect
require github.com/davecgh/go-xdr v0.0.0-20161123171359-e6a2ba005892

Binary file not shown.
Loading…
Cancel
Save