diff --git a/cmd/file.go b/cmd/file.go index 92379210..5434697a 100644 --- a/cmd/file.go +++ b/cmd/file.go @@ -148,9 +148,7 @@ var fileCmd = &cobra.Command{ ff, err := voltFile.ReadLinesOrLiteral(args[0]) _ = err - for _, target := range ff { - targets = append(targets, target) - } + targets = append(targets, ff...) // Remove Deplicated value targets = voltUtils.UniqueStringSlice(targets) diff --git a/lib/func.go b/lib/func.go index 1d9b0ef0..fa35dd13 100644 --- a/lib/func.go +++ b/lib/func.go @@ -67,9 +67,7 @@ func Initialize(target Target, options Options) model.Options { OutputResponse: false, } if len(options.UniqParam) > 0 { - for _, v := range options.UniqParam { - newOptions.UniqParam = append(newOptions.UniqParam, v) - } + newOptions.UniqParam = append(newOptions.UniqParam, options.UniqParam...) } if target.Method != "" { newOptions.Method = target.Method @@ -78,9 +76,7 @@ func Initialize(target Target, options Options) model.Options { newOptions.Cookie = options.Cookie } if len(options.Header) > 0 { - for _, v := range options.Header { - newOptions.Header = append(newOptions.Header, v) - } + newOptions.Header = append(newOptions.Header, options.Header...) } if options.BlindURL != "" { newOptions.BlindURL = options.BlindURL @@ -107,9 +103,7 @@ func Initialize(target Target, options Options) model.Options { newOptions.IgnoreReturn = options.IgnoreReturn } if len(options.IgnoreParams) > 0 { - for _, v := range options.IgnoreParams { - newOptions.IgnoreParams = append(newOptions.IgnoreParams, v) - } + newOptions.IgnoreParams = append(newOptions.IgnoreParams, options.IgnoreParams...) } if options.Trigger != "" { newOptions.Trigger = options.Trigger diff --git a/pkg/optimization/abstraction.go b/pkg/optimization/abstraction.go index a7c214a7..aef1cc29 100644 --- a/pkg/optimization/abstraction.go +++ b/pkg/optimization/abstraction.go @@ -137,9 +137,7 @@ func FindIndexesInLine(text, key string, lineSize, pointing int) []int { if pointer != -1 { tempIndexes := FindIndexesInLine(text[pointer+1:], key, lineSize, pointer+pointing+1) indexes = append(indexes, pointer+lineSize+pointing) - for _, v := range tempIndexes { - indexes = append(indexes, v) - } + indexes = append(indexes, tempIndexes...) } return indexes }