feat(llgo/chore/llcppg): add JSONPath

This commit is contained in:
morpingsss
2024-07-29 10:52:10 +08:00
committed by luoliwoshang
parent f0d17b13f2
commit 0d3180271b
2 changed files with 10 additions and 1 deletions

View File

@@ -64,11 +64,19 @@ func main() {
jsonData, err := json.MarshalIndent(symbolInfo, "", " ")
check(err)
// 写入文件
fileName := "llcppg.symb.json"
err = os.WriteFile(fileName, jsonData, 0644)
check(err)
absJSONPath, err := filepath.Abs(fileName)
check(err)
config.JSONPath = absJSONPath
updatedCfgData, err := json.MarshalIndent(config, "", " ")
check(err)
err = os.WriteFile(cfgFile, updatedCfgData, 0644)
check(err)
}
func check(err error) {