func (rm *resourceManager) readConfig() error {

	resources := &types.ResourceConfList{}
	rawBytes, err := ioutil.ReadFile(rm.configFile)

	if err != nil {
		return fmt.Errorf("error reading file %s, %v", rm.configFile, err)

	}

	if err = json.Unmarshal(rawBytes, resources); err != nil {
		return fmt.Errorf("error unmarshalling raw bytes %v", err)
	}

	for i := range resources.ResourceList {
		rm.configList = append(rm.configList, &resources.ResourceList[i])
	}

	return nil
}
// Read and validate configurations from Config file
Read and validate configurations from Config file
// Read and validate configurations from Config file
func (rm *resourceManager) readConfig() error {
	resources := &types.ResourceConfList{}
	rawBytes, err := ioutil.ReadFile(rm.configFile)
	if err != nil {
		return fmt.Errorf("error reading file %s, %v", rm.configFile, err)
	}
	if err = json.Unmarshal(rawBytes, resources); err != nil {
		return fmt.Errorf("error unmarshalling raw bytes %v", err)
	}
	for i := range resources.ResourceList {
		rm.configList = append(rm.configList, &resources.ResourceList[i])
	}
	return nil
}
func ( rm * resourceManager ) readConfig ( ) error { resources := & types . ResourceConfList { } rawBytes , err := ioutil . ReadFile ( rm . configFile ) if err != nil { return fmt . Errorf ( " " , rm . configFile , err ) } if err = json . Unmarshal ( rawBytes , resources ) ; err != nil { return fmt . Errorf ( " " , err ) } for i := range resources . ResourceList { rm . configList = append ( rm . configList , & resources . ResourceList [ i ] ) } return nil }
Read and validate configurations from Config file
Read and validate configurations from Config file