Documentation
¶
Overview ¶
Package util provides common utilities for Gas Town.
Package util provides utility functions for Gas Town. This file was created as part of an E2E polecat workflow test.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AtomicWriteFile ¶
AtomicWriteFile writes data to a file atomically. It first writes to a temporary file, then renames it to the target path. This prevents data corruption if the process crashes during write. The rename operation is atomic on POSIX systems.
func AtomicWriteJSON ¶
AtomicWriteJSON writes JSON data to a file atomically. It first writes to a temporary file, then renames it to the target path. This prevents data corruption if the process crashes during write. The rename operation is atomic on POSIX systems.
func ExecRun ¶
ExecRun runs a command in the specified directory. If the command fails, stderr content is included in the error message.
func ExecWithOutput ¶
ExecWithOutput runs a command in the specified directory and returns stdout. If the command fails, stderr content is included in the error message.
func ProcessExists ¶
ProcessExists checks if a process with the given PID exists. It sends signal 0 to the process, which doesn't actually send a signal but does perform error checking to see if the process exists.
Types ¶
This section is empty.