code: func LoadPlatforms(filename string) error {
  	// if filename is empty, skip the metadata loading
  	if filename == "" {
  		return nil
  	}
  
  	relativePath := filepath.Dir(filename)
  	// Attempt to load root certificate metadata
  	log.Debug("Loading platform metadata: ", filename)
  	bytes, err := ioutil.ReadFile(filename)
  	if err != nil {
  		return fmt.Errorf("platform metadata failed to load: %v", err)
  	}
  	var rawPlatforms []Platform
  	if bytes != nil {
  		err = json.Unmarshal(bytes, &rawPlatforms)
  		if err != nil {
  			return fmt.Errorf("platform metadata failed to parse: %v", err)
  		}
  	}
  
  	for _, platform := range rawPlatforms {
  		if platform.KeyStoreFile != "" {
  			platform.KeyStoreFile = path.Join(relativePath, platform.KeyStoreFile)
  		}
  		ok := platform.ParseAndLoad()
  		if !ok {
  			// erase all loaded platforms
  			Platforms = nil
  			return fmt.Errorf("fail to finalize the parsing of platform metadata: %v", platform)
  		}
  
  		log.Infof("Platform metadata is loaded: %v %v", platform.Name, len(platform.KeyStore))
  		Platforms = append(Platforms, platform)
  	}
  
  	return nil
  }
docs: // LoadPlatforms reads the file content as a json object array and convert it
  // to Platforms.