Documentation ¶
Overview ¶
Package must contains functions that panic on error.
Index ¶
- func CopyFile(source, dest string, perms fs.FileMode)
- func FirstLineBytes(data []byte) []byte
- func Fprintf(w io.Writer, format string, v ...any)
- func Listen(network string, address string) net.Listener
- func MarshalAndIndentJSON(v any, prefix string, indent string) []byte
- func MarshalJSON(v any) []byte
- func NewHTTPRequest(method string, url string, body io.Reader) *http.Request
- func ParseURL(URL string) *url.URL
- func ReadFile(filename string) []byte
- func Run(logger model.Logger, command string, args ...string)
- func RunCommandLine(logger model.Logger, cmdline string)
- func RunCommandLineQuiet(cmdline string)
- func RunOutput(logger model.Logger, command string, args ...string) []byte
- func RunOutputQuiet(command string, args ...string) []byte
- func RunQuiet(command string, args ...string)
- func SplitHostPort(hostport string) (host string, port string)
- func UnmarshalJSON(data []byte, v any)
- func WriteFile(filename string, content []byte, mode fs.FileMode)
- type File
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyFile ¶
CopyFile is like shellx.CopyFile but calls runtimex.PanicOnError on failure.
func FirstLineBytes ¶
FirstLineBytes takes in input a sequence of bytes and returns in output the first line. This function will call runtimex.PanicOnError on failure.
func Fprintf ¶
Fprintf is like fmt.Fprintf but calls runtimex.PanicOnError on failure.
func Listen ¶
Listen is like net.Listen but calls runtimex.PanicOnError on failure.
func MarshalAndIndentJSON ¶
MarshalAndIndentJSON is like json.MarshalIndent but calls runtimex.PanicOnError on failure.
func MarshalJSON ¶
MarshalJSON is like json.Marshal but calls runtimex.PanicOnError on failure.
func NewHTTPRequest ¶
NewHTTPRequest is like http.NewRequest but calls runtimex.PanicOnError on failure.
func ParseURL ¶
ParseURL is like url.Parse but calls runtimex.PanicOnError on failure.
func ReadFile ¶
ReadFile is like os.ReadFile but calls runtimex.PanicOnError on failure.
func Run ¶
Run is like shellx.Run but calls runtimex.PanicOnError on failure.
func RunCommandLine ¶
RunCommandLine is like shellx.RunCommandLine but calls runtimex.PanicOnError on failure.
func RunCommandLineQuiet ¶
func RunCommandLineQuiet(cmdline string)
RunCommandLineQuiet is like shellx.RunCommandLineQuiet but calls runtimex.PanicOnError on failure.
func RunOutput ¶
RunOutput is like shellx.Output but calls runtimex.PanicOnError on failure.
func RunOutputQuiet ¶
RunOutputQuiet is like shellx.OutputQuiet but calls runtimex.PanicOnError on failure.
func RunQuiet ¶
RunQuiet is like shellx.RunQuiet but calls runtimex.PanicOnError on failure.
func SplitHostPort ¶
SplitHostPort is like net.SplitHostPort but calls runtimex.PanicOnError on failure.
func UnmarshalJSON ¶
UnmarshalJSON is like json.Marshal but calls runtimex.PanicOnError on failure.
func WriteFile ¶
WriteFile is like os.WriteFile but calls runtimex.PanicOnError on failure.
Types ¶
type File ¶
File wraps os.File.
func CreateFile ¶
CreateFile is like os.Create but calls runtimex.PanicOnError on failure.
func OpenFile ¶
OpenFile is like os.Open but calls runtimex.PanicOnError on failure.
func (*File) MustClose ¶
func (fp *File) MustClose()
MustClose is like os.File.Close but calls runtimex.PanicOnError on failure.