Skip to content

Commit

Permalink
Merge pull request #30 from Morganamilo/slice
Browse files Browse the repository at this point in the history
Convert varargs to slices
  • Loading branch information
Morganamilo committed Oct 21, 2018
2 parents a9342c6 + 1cbb2a0 commit 676ad6b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions handle.go
Expand Up @@ -144,7 +144,7 @@ func (h *Handle) AddCacheDir(hookDir string) error {
})
}

func (h *Handle) SetCacheDirs(hookDirs ...string) error {
func (h *Handle) SetCacheDirs(hookDirs []string) error {
return h.optionSetList(hookDirs, func(handle *C.alpm_handle_t, l *C.alpm_list_t) C.int {
return C.alpm_option_set_cachedirs(handle, l)
})
Expand All @@ -168,7 +168,7 @@ func (h *Handle) AddHookDir(hookDir string) error {
})
}

func (h *Handle) SetHookDirs(hookDirs ...string) error {
func (h *Handle) SetHookDirs(hookDirs []string) error {
return h.optionSetList(hookDirs, func(handle *C.alpm_handle_t, l *C.alpm_list_t) C.int {
return C.alpm_option_set_hookdirs(handle, l)
})
Expand Down Expand Up @@ -242,7 +242,7 @@ func (h *Handle) AddNoUpgrade(hookDir string) error {
})
}

func (h *Handle) SetNoUpgrades(hookDirs ...string) error {
func (h *Handle) SetNoUpgrades(hookDirs []string) error {
return h.optionSetList(hookDirs, func(handle *C.alpm_handle_t, l *C.alpm_list_t) C.int {
return C.alpm_option_set_noupgrades(handle, l)
})
Expand Down Expand Up @@ -272,7 +272,7 @@ func (h *Handle) AddNoExtract(hookDir string) error {
})
}

func (h *Handle) SetNoExtracts(hookDirs ...string) error {
func (h *Handle) SetNoExtracts(hookDirs []string) error {
return h.optionSetList(hookDirs, func(handle *C.alpm_handle_t, l *C.alpm_list_t) C.int {
return C.alpm_option_set_noextracts(handle, l)
})
Expand Down Expand Up @@ -302,7 +302,7 @@ func (h *Handle) AddIgnorePkg(hookDir string) error {
})
}

func (h *Handle) SetIgnorePkgs(hookDirs ...string) error {
func (h *Handle) SetIgnorePkgs(hookDirs []string) error {
return h.optionSetList(hookDirs, func(handle *C.alpm_handle_t, l *C.alpm_list_t) C.int {
return C.alpm_option_set_ignorepkgs(handle, l)
})
Expand All @@ -326,7 +326,7 @@ func (h *Handle) AddIgnoreGroup(hookDir string) error {
})
}

func (h *Handle) SetIgnoreGroups(hookDirs ...string) error {
func (h *Handle) SetIgnoreGroups(hookDirs []string) error {
return h.optionSetList(hookDirs, func(handle *C.alpm_handle_t, l *C.alpm_list_t) C.int {
return C.alpm_option_set_ignoregroups(handle, l)
})
Expand Down Expand Up @@ -370,7 +370,7 @@ func (h *Handle) AddAssumeInstalled(dep Depend) error {
return nil
}

func (h *Handle) SetAssumeInstalled(deps ...Depend) error {
func (h *Handle) SetAssumeInstalled(deps []Depend) error {
//calling this function the first time causes alpm to set the
//assumeinstalled list to a list containing go allocated alpm_depend_t's
//this is bad because alpm might at some point tree to free them
Expand Down

0 comments on commit 676ad6b

Please sign in to comment.