func GetLinters(config settings.LintConfig) ([]Linter, error) {
	var linters []Linter
	var ok bool
	if config.Group != "" {
		linters, ok = GroupToLinters[config.Group]
		if !ok {
			return nil, fmt.Errorf("unknown lint group: %s", config.Group)
		}
	} else if !config.NoDefault {
		// we ignore NoDefault if Group is set
		linters = DefaultLinters
	}
	for _, id := range config.IncludeIDs {
		if err := checkLintID(id); err != nil {
			return nil, err
		}
	}
	for _, excludeID := range config.ExcludeIDs {
		if err := checkLintID(excludeID); err != nil {
			return nil, err
		}
	}
	for ignoreID := range config.IgnoreIDToFilePaths {
		if err := checkLintID(ignoreID); err != nil {
			return nil, err
		}
	}
	if len(config.IncludeIDs) == 0 && len(config.ExcludeIDs) == 0 {
		return linters, nil
	}

	// Apply the configured linters to the default group.
	linterMap := make(map[string]Linter, len(linters)+len(config.IncludeIDs)-len(config.ExcludeIDs))
	for _, l := range linters {
		linterMap[l.ID()] = l
	}
	if len(config.IncludeIDs) > 0 {
		for _, l := range AllLinters {
			for _, id := range config.IncludeIDs {
				if l.ID() == id {
					linterMap[id] = l
				}
			}
		}
	}
	for _, excludeID := range config.ExcludeIDs {
		delete(linterMap, excludeID)
	}

	result := make([]Linter, 0, len(linterMap))
	for _, l := range linterMap {
		result = append(result, l)
	}
	return result, nil
}
// GetLinters returns the Linters for the LintConfig.
//
// The group, if set, is expected to be lower-case.
//
// The configuration is expected to be valid, deduplicated, and all upper-case.
// IncludeIDs and ExcludeIDs MUST NOT have an intersection.
//
// If the config came from the settings package, this is already validated.
GetLinters returns the Linters for the LintConfig.

The group, if set, is expected to be lower-case.

The configuration is expected to be valid, deduplicated, and all upper-case.
IncludeIDs and ExcludeIDs MUST NOT have an intersection.

If the config came from the settings package, this is already validated.
// GetLinters returns the Linters for the LintConfig . // // The group if set is expected to be lower - case . // // The configuration is expected to be valid deduplicated and all upper - case . // IncludeIDs and ExcludeIDs MUST NOT have an intersection . // // If the config came from the settings package this is already validated .
func GetLinters(config settings.LintConfig) ([]Linter, error) {
	var linters []Linter
	var ok bool
	if config.Group != "" {
		linters, ok = GroupToLinters[config.Group]
		if !ok {
			return nil, fmt.Errorf("unknown lint group: %s", config.Group)
		}
	} else if !config.NoDefault {
		linters = DefaultLinters
	}
	for _, id := range config.IncludeIDs {
		if err := checkLintID(id); err != nil {
			return nil, err
		}
	}
	for _, excludeID := range config.ExcludeIDs {
		if err := checkLintID(excludeID); err != nil {
			return nil, err
		}
	}
	for ignoreID := range config.IgnoreIDToFilePaths {
		if err := checkLintID(ignoreID); err != nil {
			return nil, err
		}
	}
	if len(config.IncludeIDs) == 0 && len(config.ExcludeIDs) == 0 {
		return linters, nil
	}
	linterMap := make(map[string]Linter, len(linters)+len(config.IncludeIDs)-len(config.ExcludeIDs))
	for _, l := range linters {
		linterMap[l.ID()] = l
	}
	if len(config.IncludeIDs) > 0 {
		for _, l := range AllLinters {
			for _, id := range config.IncludeIDs {
				if l.ID() == id {
					linterMap[id] = l
				}
			}
		}
	}
	for _, excludeID := range config.ExcludeIDs {
		delete(linterMap, excludeID)
	}
	result := make([]Linter, 0, len(linterMap))
	for _, l := range linterMap {
		result = append(result, l)
	}
	return result, nil
}
func GetLinters ( config settings . LintConfig ) ( [ ] Linter , error ) { var linters [ ] Linter var ok bool if config . Group != " " { linters , ok = GroupToLinters [ config . Group ] if ! ok { return nil , fmt . Errorf ( " " , config . Group ) } } else if ! config . NoDefault { linters = DefaultLinters } for _ , id := range config . IncludeIDs { if err := checkLintID ( id ) ; err != nil { return nil , err } } for _ , excludeID := range config . ExcludeIDs { if err := checkLintID ( excludeID ) ; err != nil { return nil , err } } for ignoreID := range config . IgnoreIDToFilePaths { if err := checkLintID ( ignoreID ) ; err != nil { return nil , err } } if len ( config . IncludeIDs ) == 0 && len ( config . ExcludeIDs ) == 0 { return linters , nil } linterMap := make ( map [ string ] Linter , len ( linters ) + len ( config . IncludeIDs ) - len ( config . ExcludeIDs ) ) for _ , l := range linters { linterMap [ l . ID ( ) ] = l } if len ( config . IncludeIDs ) > 0 { for _ , l := range AllLinters { for _ , id := range config . IncludeIDs { if l . ID ( ) == id { linterMap [ id ] = l } } } } for _ , excludeID := range config . ExcludeIDs { delete ( linterMap , excludeID ) } result := make ( [ ] Linter , 0 , len ( linterMap ) ) for _ , l := range linterMap { result = append ( result , l ) } return result , nil }
GetLinters returns the Linters for the LintConfig.
GetLinters returns the Linters for the LintConfig .
// we ignore NoDefault if Group is set // Apply the configured linters to the default group.