func LoadComponent(filename string) (Component, error) {
	var c Component

	// handle varying location of component directory depending on test/prod
	fileContents, err := ioutil.ReadFile(productionComponentDirectory + filename)
	if err != nil {
		fileContents, err = ioutil.ReadFile(relativeComponentDirectory + filename)
		if err != nil {
			fileContents, err = ioutil.ReadFile(testComponentDirectory + filename)
			if err != nil {
				fileContents, err = ioutil.ReadFile(filename)
				if err != nil {
					return c, err
				}
			}
		}
	}

	err = json.Unmarshal(fileContents, &c)
	if err != nil {
		return c, err
	}
	return c, nil
}
// LoadComponent - Utility to load Manifest Data Model containing all Rules, Tests and Conditions
Utility to load Manifest Data Model containing all Rules, Tests and Conditions
// LoadComponent - Utility to load Manifest Data Model containing all Rules Tests and Conditions
func LoadComponent(filename string) (Component, error) {
	var c Component
	fileContents, err := ioutil.ReadFile(productionComponentDirectory + filename)
	if err != nil {
		fileContents, err = ioutil.ReadFile(relativeComponentDirectory + filename)
		if err != nil {
			fileContents, err = ioutil.ReadFile(testComponentDirectory + filename)
			if err != nil {
				fileContents, err = ioutil.ReadFile(filename)
				if err != nil {
					return c, err
				}
			}
		}
	}
	err = json.Unmarshal(fileContents, &c)
	if err != nil {
		return c, err
	}
	return c, nil
}
func LoadComponent ( filename string ) ( Component , error ) { var c Component fileContents , err := ioutil . ReadFile ( productionComponentDirectory + filename ) if err != nil { fileContents , err = ioutil . ReadFile ( relativeComponentDirectory + filename ) if err != nil { fileContents , err = ioutil . ReadFile ( testComponentDirectory + filename ) if err != nil { fileContents , err = ioutil . ReadFile ( filename ) if err != nil { return c , err } } } } err = json . Unmarshal ( fileContents , & c ) if err != nil { return c , err } return c , nil }
Utility to load Manifest Data Model containing all Rules, Tests and Conditions
Utility to load Manifest Data Model containing all Rules Tests and Conditions
// handle varying location of component directory depending on test/prod