Replace bash release helper scripts with Go progam

This commit is contained in:
jregan
2020-10-08 10:45:12 -07:00
parent 4052cd4fd8
commit 0c169e96e5
31 changed files with 2130 additions and 176 deletions

View File

@@ -0,0 +1,26 @@
package utils
import (
"log"
"os"
)
func DirExists(name string) bool {
info, err := os.Stat(name)
if os.IsNotExist(err) {
return false
}
return info.IsDir()
}
func SliceToSet(slice []string) map[string]bool {
result := make(map[string]bool)
for _, x := range slice {
if _, ok := result[x]; ok {
log.Fatalf("programmer error - repeated value: %s", x)
} else {
result[x] = true
}
}
return result
}