MCPcopy Index your code
hub / github.com/authorizerdev/authorizer / CreateFile

Function CreateFile

internal/utils/file.go:34–48  ·  view source on GitHub ↗

CreateFile creates a file on given path with given content

(filePath string, content string)

Source from the content-addressed store, hash-verified

32
33// CreateFile creates a file on given path with given content
34func CreateFile(filePath string, content string) error {
35 f, err := os.Create(filePath)
36 if err != nil {
37 return err
38 }
39
40 defer func() { _ = f.Close() }()
41
42 _, err = f.WriteString(content)
43
44 if err != nil {
45 return err
46 }
47 return nil
48}

Callers

nothing calls this directly

Calls 1

CloseMethod · 0.65

Tested by

no test coverage detected