MakeJITMemoryConfigFile 生成JIT内存宽限配置
(c *cli.Context)
| 37 | |
| 38 | // MakeJITMemoryConfigFile 生成JIT内存宽限配置 |
| 39 | func 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 | } |
nothing calls this directly
no test coverage detected