refactor: move actions into internal

This commit is contained in:
Simon Aronsson 2019-07-21 22:22:30 +02:00
parent 62f603bb25
commit a425bf1024
17 changed files with 26 additions and 29 deletions

View file

@ -1,5 +1,6 @@
package util
// SliceEqual compares two slices and checks whether they have equal content
func SliceEqual(s1, s2 []string) bool {
if len(s1) != len(s2) {
return false
@ -14,6 +15,7 @@ func SliceEqual(s1, s2 []string) bool {
return true
}
// SliceSubtract subtracts the content of slice a2 from slice a1
func SliceSubtract(a1, a2 []string) []string {
a := []string{}
@ -35,6 +37,7 @@ func SliceSubtract(a1, a2 []string) []string {
return a
}
// StringMapSubtract subtracts the content of structmap m2 from structmap m1
func StringMapSubtract(m1, m2 map[string]string) map[string]string {
m := map[string]string{}
@ -51,6 +54,7 @@ func StringMapSubtract(m1, m2 map[string]string) map[string]string {
return m
}
// StructMapSubtract subtracts the content of structmap m2 from structmap m1
func StructMapSubtract(m1, m2 map[string]struct{}) map[string]struct{} {
m := map[string]struct{}{}

View file

@ -5,8 +5,6 @@ import (
"testing"
)
func TestSliceEqual_True(t *testing.T) {
s1 := []string{"a", "b", "c"}
s2 := []string{"a", "b", "c"}