rename 'isVariableType' to standardized boolean meaning of variable

This commit is contained in:
Baipyrus 2024-10-01 20:00:31 +02:00
parent 06637360d6
commit 9eb5982bb7

View File

@ -9,12 +9,12 @@ import (
"golang.org/x/sys/windows/registry" "golang.org/x/sys/windows/registry"
) )
func processVars(replaceVariable bool, args []string, configCmd string) ([]string, string) { func processVars(isVariableType bool, args []string, configCmd string) ([]string, string) {
var configArgs []string var configArgs []string
for _, arg := range args { for _, arg := range args {
// If not replacable, append // If not replacable, append
if !replaceVariable { if !isVariableType {
configArgs = append(configArgs, arg) configArgs = append(configArgs, arg)
continue continue
} }
@ -60,9 +60,9 @@ func generateCommands(variants []*util.Variant, configCmd, proxyServer string) [
// Generate one command per variant // Generate one command per variant
for _, variant := range variants { for _, variant := range variants {
replaceVariable := variant.Type == util.VARIABLE isVariableType := variant.Type == util.VARIABLE
configArgs, configCmd := processVars(replaceVariable, variant.Arguments, configCmd) configArgs, configCmd := processVars(isVariableType, variant.Arguments, configCmd)
configArgs, configCmd = injectProxy(configArgs, configCmd, proxyServer, variant) configArgs, configCmd = injectProxy(configArgs, configCmd, proxyServer, variant)
commands = append(commands, &util.Command{Name: configCmd, Arguments: configArgs}) commands = append(commands, &util.Command{Name: configCmd, Arguments: configArgs})