Initial 2024-01-26
This commit is contained in:
32
cmpSnipper/cmpSnipperSnipLeftMenu.go
Normal file
32
cmpSnipper/cmpSnipperSnipLeftMenu.go
Normal file
@@ -0,0 +1,32 @@
|
||||
|
||||
package cmpSnipper
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
func (app *App) LeftMenuSnip(parm any) (any, error) {
|
||||
// app.Log("Read data")
|
||||
|
||||
mainMenuFile, err := app.ConfGetStr("mainMenuFile")
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
data, err := app.FileReadLimit(mainMenuFile, 1048576)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var res = map[string]interface{}{}
|
||||
|
||||
err = json.Unmarshal(data, &res)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return res, nil
|
||||
}
|
Reference in New Issue
Block a user