MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / fixBunSplit

Function fixBunSplit

tools/mage/sql.go:89–102  ·  view source on GitHub ↗
(path string, filename string)

Source from the content-addressed store, hash-verified

87}
88
89func fixBunSplit(path string, filename string) error {
90 if !strings.HasSuffix(filename, ".sql") {
91 return nil
92 }
93 filePath := path + "/" + filename
94 file, err := os.ReadFile(filePath)
95 if err != nil {
96 return err
97 }
98
99 file = []byte(strings.ReplaceAll(string(file), "-- bun:split", "--bun:split"))
100
101 return os.WriteFile(filePath, file, 0o744)
102}

Callers

nothing calls this directly

Calls 2

WriteFileMethod · 0.80
ReadFileMethod · 0.65

Tested by

no test coverage detected