Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for AsBytesOrFail (1.62 sec)

  1. pkg/test/util/file/file.go

    )
    
    // AsBytes is a simple wrapper around os.ReadFile provided for completeness.
    func AsBytes(filename string) ([]byte, error) {
    	return os.ReadFile(filename)
    }
    
    // AsBytesOrFail calls AsBytes and fails the test if any errors occurred.
    func AsBytesOrFail(t test.Failer, filename string) []byte {
    	t.Helper()
    	content, err := AsBytes(filename)
    	if err != nil {
    		t.Fatal(err)
    	}
    	return content
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 17 02:22:22 UTC 2023
    - 4.6K bytes
    - Viewed (0)
Back to top