MCPcopy Index your code
hub / github.com/SummerSec/SpringExploit / writeStringToFile

Function writeStringToFile

cmd/commons/utils/saveresult.go:28–38  ·  view source on GitHub ↗

写入文件

(filepath, content string)

Source from the content-addressed store, hash-verified

26
27//写入文件
28func writeStringToFile(filepath, content string) {
29 //打开文件,没有则创建,有则append内容
30 w1, error := os.OpenFile(filepath, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0644)
31 checkError(error)
32
33 _, err1 := w1.Write([]byte(content + "\n"))
34 checkError(err1)
35
36 errC := w1.Close()
37 checkError(errC)
38}
39
40//写入文件
41func writeBytesToFile(filepath string, content []byte) {

Callers

nothing calls this directly

Calls 1

checkErrorFunction · 0.85

Tested by

no test coverage detected