Inline single-use methods

This commit is contained in:
Seednode 2024-02-11 11:12:30 -06:00
parent 09bb2def7e
commit 3fd2bf6bb3
3 changed files with 3 additions and 11 deletions

View File

@ -23,18 +23,10 @@ func (filters *filters) hasIncludes() bool {
return len(filters.included) != 0 && Filtering return len(filters.included) != 0 && Filtering
} }
func (filters *filters) includes() string {
return strings.Join(filters.included, ",")
}
func (filters *filters) hasExcludes() bool { func (filters *filters) hasExcludes() bool {
return len(filters.excluded) != 0 && Filtering return len(filters.excluded) != 0 && Filtering
} }
func (filters *filters) excludes() string {
return strings.Join(filters.excluded, ",")
}
func (filters *filters) apply(fileList []string) []string { func (filters *filters) apply(fileList []string) []string {
result := make([]string, len(fileList)) result := make([]string, len(fileList))

View File

@ -17,7 +17,7 @@ import (
const ( const (
AllowedCharacters string = `^[A-z0-9.\-_]+$` AllowedCharacters string = `^[A-z0-9.\-_]+$`
ReleaseVersion string = "8.7.3" ReleaseVersion string = "8.7.4"
) )
var ( var (

View File

@ -47,12 +47,12 @@ func generateQueryParams(filters *filters, sortOrder, refreshInterval string) st
if Filtering { if Filtering {
queryParams.WriteString("include=") queryParams.WriteString("include=")
if filters.hasIncludes() { if filters.hasIncludes() {
queryParams.WriteString(filters.includes()) queryParams.WriteString(strings.Join(filters.included, ","))
} }
queryParams.WriteString("&exclude=") queryParams.WriteString("&exclude=")
if filters.hasExcludes() { if filters.hasExcludes() {
queryParams.WriteString(filters.excludes()) queryParams.WriteString(strings.Join(filters.excluded, ","))
} }
hasParams = true hasParams = true