MCPcopy Create free account
hub / github.com/LanceLRQ/deer-executor / MakeJITMemoryConfigFile

Function MakeJITMemoryConfigFile

client/generate/config.go:39–62  ·  view source on GitHub ↗

MakeJITMemoryConfigFile 生成JIT内存宽限配置

(c *cli.Context)

Source from the content-addressed store, hash-verified

37
38// MakeJITMemoryConfigFile 生成JIT内存宽限配置
39func MakeJITMemoryConfigFile(c *cli.Context) error {
40 config := constants.MemorySizeForJIT
41 output := c.String("output")
42 if output == "" {
43 output = "./jit_memory.json"
44 }
45 s, err := os.Stat(output)
46 if s != nil || os.IsExist(err) {
47 log.Fatal("output file exists")
48 return nil
49 }
50 fmt.Println(output)
51 fp, err := os.OpenFile(output, os.O_WRONLY|os.O_CREATE, 0644)
52 if err != nil {
53 log.Fatalf("open output file error: %s\n", err.Error())
54 return nil
55 }
56 defer fp.Close()
57 _, err = fp.WriteString(utils.ObjectToJSONStringFormatted(config))
58 if err != nil {
59 return err
60 }
61 return nil
62}

Callers

nothing calls this directly

Calls 3

StringMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected