INNER CODE UNIT · Go

func

sy-vendor/Gobi · config/manager.go:478

func (ci *ConfigImporter) ImportFromYAML(filepath string) (*Config, error) {
	data, err := os.ReadFile(filepath)
	if err != nil {
		return nil, fmt.Errorf("failed to read config file: %w", err)
	}

	var config Config
	if err := yaml.Unmarshal(data, &config); err != nil {
		return nil, fmt.Errorf("failed to unmarshal config: %w", err)
	}

	return &config, nil
}

// ImportFromJSON 从JSON文件导入配置
func (ci *ConfigImporter) ImportFromJSON(filepath string) (*Config, error) {
	data, err := os.ReadFile(filepath)
	if err != nil {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…