Skip to content

Commit

Permalink
Move IsStringInSlice out from fileutils (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
yahavi authored Aug 15, 2022
1 parent 1123c4f commit 507baf9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
12 changes: 2 additions & 10 deletions utils/fileutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"bufio"
"encoding/json"
"fmt"
"github.com/jfrog/build-info-go/entities"
"io"
"io/ioutil"
"net/http"
Expand All @@ -14,6 +13,8 @@ import (
"strconv"
"strings"
"time"

"github.com/jfrog/build-info-go/entities"
)

const (
Expand Down Expand Up @@ -519,15 +520,6 @@ func CreateDirIfNotExist(path string) error {
return err
}

func IsStringInSlice(string string, strings []string) bool {
for _, v := range strings {
if v == string {
return true
}
}
return false
}

func IsPathSymlink(path string) bool {
f, _ := os.Lstat(path)
return f != nil && IsFileSymlink(f)
Expand Down
9 changes: 9 additions & 0 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,12 @@ func GetRegExp(regex string) (*regexp.Regexp, error) {
}
return regExp, nil
}

func IsStringInSlice(str string, strings []string) bool {
for _, v := range strings {
if v == str {
return true
}
}
return false
}

0 comments on commit 507baf9

Please sign in to comment.