Move util func to utils
This commit is contained in:
parent
2229437a7f
commit
abd272635e
10
restic.go
10
restic.go
@ -16,16 +16,6 @@ var (
|
|||||||
ErrRepoNotFound = errors.Join(errors.New("repository not found or uninitialized"), ErrRestic)
|
ErrRepoNotFound = errors.Join(errors.New("repository not found or uninitialized"), ErrRestic)
|
||||||
)
|
)
|
||||||
|
|
||||||
func lineIn(needle string, haystack []string) bool {
|
|
||||||
for _, line := range haystack {
|
|
||||||
if line == needle {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
func maybeAddArgString(args []string, name, value string) []string {
|
func maybeAddArgString(args []string, name, value string) []string {
|
||||||
if value != "" {
|
if value != "" {
|
||||||
return append(args, name, value)
|
return append(args, name, value)
|
||||||
|
10
utils.go
10
utils.go
@ -2,6 +2,16 @@ package main
|
|||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
|
||||||
|
func lineIn(needle string, haystack []string) bool {
|
||||||
|
for _, line := range haystack {
|
||||||
|
if line == needle {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
func MergeEnvMap(parent, child map[string]string) map[string]string {
|
func MergeEnvMap(parent, child map[string]string) map[string]string {
|
||||||
result := map[string]string{}
|
result := map[string]string{}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user