Skip to content

Commit

Permalink
Merge pull request #97 from edoardottt/main
Browse files Browse the repository at this point in the history
Use utils helpers + fix double default value in StringSlice
  • Loading branch information
Mzack9999 committed Nov 11, 2022
2 parents e837d49 + f27e2b1 commit 3295469
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
5 changes: 2 additions & 3 deletions go.mod
Expand Up @@ -5,8 +5,6 @@ go 1.18
require (
github.com/cnf/structhash v0.0.0-20201127153200-e1b16c1ebc08
github.com/pkg/errors v0.9.1
github.com/projectdiscovery/fileutil v0.0.0-20220705195237-01becc2a8963
github.com/projectdiscovery/stringsutil v0.0.2
github.com/stretchr/testify v1.8.1
gopkg.in/yaml.v3 v3.0.1
)
Expand All @@ -18,6 +16,7 @@ require (
github.com/gorilla/css v1.0.0 // indirect
github.com/microcosm-cc/bluemonday v1.0.21 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/projectdiscovery/utils v0.0.2
github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca // indirect
golang.org/x/net v0.0.0-20221002022538-bcab6841153b // indirect
golang.org/x/net v0.1.0 // indirect
)
4 changes: 4 additions & 0 deletions go.sum
Expand Up @@ -20,6 +20,8 @@ github.com/projectdiscovery/fileutil v0.0.0-20220705195237-01becc2a8963/go.mod h
github.com/projectdiscovery/stringsutil v0.0.0-20220422150559-b54fb5dc6833/go.mod h1:oTRc18WBv9t6BpaN9XBY+QmG28PUpsyDzRht56Qf49I=
github.com/projectdiscovery/stringsutil v0.0.2 h1:uzmw3IVLJSMW1kEg8eCStG/cGbYYZAja8BH3LqqJXMA=
github.com/projectdiscovery/stringsutil v0.0.2/go.mod h1:EJ3w6bC5fBYjVou6ryzodQq37D5c6qbAYQpGmAy+DC0=
github.com/projectdiscovery/utils v0.0.2 h1:lif4OYBqd8jCf0glRBfSs2lT4nMtNjHjeysRw8HIW8M=
github.com/projectdiscovery/utils v0.0.2/go.mod h1:PEYYkpCedmtydQRUvfWLPw0VRWpaFms4GFqNAziBANI=
github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca h1:NugYot0LIVPxTvN8n+Kvkn6TrbMyxQiuvKdEwFdR9vI=
github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca/go.mod h1:uugorj2VCxiV1x+LzaIdVa9b4S4qGAcH6cbhh4qVxOU=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand All @@ -33,6 +35,8 @@ github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKs
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
golang.org/x/net v0.0.0-20221002022538-bcab6841153b h1:6e93nYa3hNqAvLr0pD4PN1fFS+gKzp2zAXqrnTCstqU=
golang.org/x/net v0.0.0-20221002022538-bcab6841153b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0=
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
Expand Down
3 changes: 1 addition & 2 deletions goflags.go
Expand Up @@ -15,7 +15,7 @@ import (
"time"

"github.com/cnf/structhash"
"github.com/projectdiscovery/fileutil"
fileutil "github.com/projectdiscovery/utils/file"
"gopkg.in/yaml.v3"
)

Expand Down Expand Up @@ -345,7 +345,6 @@ func (flagSet *FlagSet) IntVar(field *int, long string, defaultValue int, usage
func (flagSet *FlagSet) StringSliceVarP(field *StringSlice, long, short string, defaultValue StringSlice, usage string, options Options) *FlagData {
optionMap[field] = options
for _, defaultItem := range defaultValue {
_ = field.Set(defaultItem)
values, _ := ToStringSlice(defaultItem, options)
for _, value := range values {
_ = field.Set(value)
Expand Down
2 changes: 1 addition & 1 deletion port.go
Expand Up @@ -5,7 +5,7 @@ import (
"strconv"
"strings"

"github.com/projectdiscovery/stringsutil"
stringsutil "github.com/projectdiscovery/utils/strings"
)

// Port is a list of unique ports in a normalized format
Expand Down
2 changes: 1 addition & 1 deletion runtime_map.go
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"strings"

"github.com/projectdiscovery/stringsutil"
stringsutil "github.com/projectdiscovery/utils/strings"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion slice_common.go
Expand Up @@ -4,7 +4,7 @@ import (
"strings"

"github.com/pkg/errors"
"github.com/projectdiscovery/fileutil"
fileutil "github.com/projectdiscovery/utils/file"
)

var quotes = []rune{'"', '\'', '`'}
Expand Down

0 comments on commit 3295469

Please sign in to comment.