Skip to content

Commit

Permalink
Support for deps tidy command (#10)
Browse files Browse the repository at this point in the history
* Support for deps tidy command
  • Loading branch information
AlexeiVainshtein authored Nov 20, 2018
1 parent 286a950 commit 11d5bc2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
6 changes: 3 additions & 3 deletions utils/io/fileutils/zip.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ func Unzip(at io.ReaderAt, size int64, dest string) error {
path := filepath.Join(dest, f.Name)

if f.FileInfo().IsDir() {
os.MkdirAll(path, f.Mode())
os.MkdirAll(path, 0700)
} else {
os.MkdirAll(filepath.Dir(path), f.Mode())
f, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, f.Mode())
os.MkdirAll(filepath.Dir(path), 0700)
f, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0700)
if err != nil {
return err
}
Expand Down
12 changes: 3 additions & 9 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,16 +235,10 @@ func CheckErrorWithMessage(err error, message string) error {
return err
}

func GetMapFromStringSlice(slice []string, sep string) map[string]string {
mapFromSlice := make(map[string]string)
func ConvertSliceToMap(slice []string) map[string]bool {
mapFromSlice := make(map[string]bool)
for _, value := range slice {
splitted := strings.Split(value, sep)
if len(splitted) == 2 {
mapFromSlice[splitted[0]] = splitted[1]
}
if len(splitted) == 1 {
mapFromSlice[splitted[0]] = ""
}
mapFromSlice[value] = true
}
return mapFromSlice
}
Expand Down

0 comments on commit 11d5bc2

Please sign in to comment.