15 lines
260 B
Go
15 lines
260 B
Go
package io
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
func ReadRequiredFile(path string, label string) ([]byte, error) {
|
|
contents, err := os.ReadFile(path)
|
|
if err != nil {
|
|
return nil, fmt.Errorf("failed to read %s file %q: %w", label, path, err)
|
|
}
|
|
return contents, nil
|
|
}
|