MCPcopy Create free account
hub / github.com/Mazzy-Stars/lain_c2 / readJSONFile

Function readJSONFile

main.go:4183–4200  ·  view source on GitHub ↗

读取结构体

(fileName string, v interface{})

Source from the content-addressed store, hash-verified

4181 if err != nil {
4182 return fmt.Errorf("failed to create directory %s: %v", uploadDir, err)
4183 }
4184 }
4185 files, err := os.ReadDir(uploadDir)
4186 if err != nil {
4187 return err
4188 }
4189 dataChatmu.Lock()
4190 defer dataChatmu.Unlock()
4191 maxChatID := chatUID()
4192 for _, f := range files {
4193 if f.IsDir() {
4194 continue
4195 }
4196 filename := f.Name()
4197 exists := false
4198 for i := range data_chat.Chats {
4199 c := &data_chat.Chats[i]
4200 if c.Message == filename && c.Type == "file" {
4201 exists = true
4202 break
4203 }

Callers 2

mainFunction · 0.85
loginFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected