MCPcopy
hub / github.com/mathaou/termdbms / WriteTextFile

Function WriteTextFile

viewer/util.go:144–149  ·  view source on GitHub ↗
(m *TuiModel, text string)

Source from the content-addressed store, hash-verified

142}
143
144func WriteTextFile(m *TuiModel, text string) (string, error) {
145 rand.Seed(time.Now().Unix())
146 fileName := m.GetSchemaName() + "_" + "renderView_" + fmt.Sprintf("%d", rand.Int()) + ".txt"
147 e := os.WriteFile(fileName, []byte(text), 0777)
148 return fileName, e
149}
150
151// IsUrl is some code I stole off stackoverflow to validate paths
152func IsUrl(fp string) bool {

Callers 2

initFunction · 0.85
WriteCSVFunction · 0.85

Calls 1

GetSchemaNameMethod · 0.80

Tested by

no test coverage detected