MCPcopy Index your code
hub / github.com/sqlc-dev/sqlc / appendToFile

Function appendToFile

cmd/sqlc-test-setup/main.go:530–538  ·  view source on GitHub ↗

appendToFile appends text to a file.

(path, text string)

Source from the content-addressed store, hash-verified

528
529// appendToFile appends text to a file.
530func appendToFile(path, text string) error {
531 f, err := os.OpenFile(path, os.O_APPEND|os.O_WRONLY, 0o644)
532 if err != nil {
533 return err
534 }
535 defer f.Close()
536 _, err = f.WriteString(text)
537 return err
538}
539
540// pgIsReady checks if PostgreSQL is running and accepting connections.
541func pgIsReady() bool {

Callers 1

startPostgreSQLFunction · 0.85

Calls 1

CloseMethod · 0.65

Tested by

no test coverage detected