diff --git a/install.go b/install.go index fcc41822..ba01139a 100644 --- a/install.go +++ b/install.go @@ -89,8 +89,8 @@ func install(parser *arguments) (err error) { return err } - remoteNamesCache := stringset.SliceToStringSet(remoteNames) - localNamesCache := stringset.SliceToStringSet(localNames) + remoteNamesCache := stringset.FromSlice(remoteNames) + localNamesCache := stringset.FromSlice(localNames) requestTargets := parser.copy().targets @@ -142,7 +142,7 @@ func install(parser *arguments) (err error) { } } - targets := stringset.SliceToStringSet(parser.targets) + targets := stringset.FromSlice(parser.targets) dp, err := getDepPool(requestTargets, warnings) if err != nil { @@ -987,8 +987,8 @@ func buildInstallPkgbuilds(dp *depPool, do *depOrder, srcinfos map[string]*gosrc //cache as a stringset. maybe make it return a string set in the first //place - remoteNamesCache := stringset.SliceToStringSet(remoteNames) - localNamesCache := stringset.SliceToStringSet(localNames) + remoteNamesCache := stringset.FromSlice(remoteNames) + localNamesCache := stringset.FromSlice(localNames) doInstall := func() error { if len(arguments.targets) == 0 { diff --git a/pkg/stringset/stringset.go b/pkg/stringset/stringset.go index 4c3eb064..7505e0da 100644 --- a/pkg/stringset/stringset.go +++ b/pkg/stringset/stringset.go @@ -60,8 +60,8 @@ func (set StringSet) Copy() StringSet { return newSet } -// SliceToStringSet creates a new StringSet from an input slice -func SliceToStringSet(in []string) StringSet { +// FromSlice creates a new StringSet from an input slice +func FromSlice(in []string) StringSet { set := make(StringSet) for _, v := range in { @@ -71,13 +71,13 @@ func SliceToStringSet(in []string) StringSet { return set } -// MakeStringSet creates a new StringSet from a set of arguments -func MakeStringSet(in ...string) StringSet { - return SliceToStringSet(in) +// Make creates a new StringSet from a set of arguments +func Make(in ...string) StringSet { + return FromSlice(in) } -// StringSetEqual compares if two StringSets have the same values -func StringSetEqual(a, b StringSet) bool { +// Equal compares if two StringSets have the same values +func Equal(a, b StringSet) bool { if a == nil && b == nil { return true } diff --git a/print.go b/print.go index 93042f5a..146d2a22 100644 --- a/print.go +++ b/print.go @@ -392,7 +392,7 @@ func printNumberOfUpdates() error { //TODO: Make it less hacky func printUpdateList(parser *arguments) error { - targets := stringset.SliceToStringSet(parser.targets) + targets := stringset.FromSlice(parser.targets) warnings := &aurWarnings{} old := os.Stdout // keep backup of the real stdout os.Stdout = nil diff --git a/vcs.go b/vcs.go index f6ea7b26..cbc04505 100644 --- a/vcs.go +++ b/vcs.go @@ -38,7 +38,7 @@ func createDevelDB() error { } bases := getBases(info) - toSkip := pkgbuildsToSkip(bases, stringset.SliceToStringSet(remoteNames)) + toSkip := pkgbuildsToSkip(bases, stringset.FromSlice(remoteNames)) _, err = downloadPkgbuilds(bases, toSkip, config.BuildDir) if err != nil { return err