github.com/Foodji/aws-lambda-go@v1.20.2/events/test/readjson.go (about)

     1  package test
     2  
     3  import (
     4  	"io/ioutil"
     5  	"testing"
     6  )
     7  
     8  // ReadJSONFromFile reads a given input file to JSON
     9  func ReadJSONFromFile(t *testing.T, inputFile string) []byte {
    10  	inputJSON, err := ioutil.ReadFile(inputFile)
    11  	if err != nil {
    12  		t.Errorf("could not open test file. details: %v", err)
    13  	}
    14  
    15  	return inputJSON
    16  }