enbas/internal/utilities/file.go
Dan Anglin ca48d1bfce
feat: post a status from a file
Allow users to post a status from a file using the --from-file flag.
If both --content and --from-file flags are used then the --content
flag takes precedence.
2024-05-31 04:18:34 +01:00

15 lines
244 B
Go

package utilities
import (
"fmt"
"os"
)
func ReadFile(path string) (string, error) {
data, err := os.ReadFile(path)
if err != nil {
return "", fmt.Errorf("unable to read the data from the file; %w", err)
}
return string(data), nil
}