chore: small fixes and cosmetic.
This commit is contained in:
parent
41c0e57eca
commit
d98621625a
8 changed files with 14 additions and 17 deletions
|
|
@ -93,8 +93,3 @@ type DebianHider struct {
|
|||
func (d DebianHider) Init() error {
|
||||
return d.path.WriteFile([]byte(Hide))
|
||||
}
|
||||
|
||||
// Initialize the file with content from Hide
|
||||
func (d DebianHider) Clean() error {
|
||||
return d.path.WriteFile([]byte("# This file is generated by \"make\", all edit will be lost.\n"))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ func (p Configure) Apply() ([]string, error) {
|
|||
}
|
||||
|
||||
case "ubuntu":
|
||||
if err := cfg.DebianHide.Clean(); err != nil {
|
||||
if err := cfg.DebianHide.Init(); err != nil {
|
||||
return res, err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -71,11 +71,11 @@ func DecodeHexInString(str string) string {
|
|||
func RemoveDuplicate[T comparable](inlist []T) []T {
|
||||
var empty T
|
||||
list := []T{}
|
||||
keys := map[T]bool{}
|
||||
keys[empty] = true
|
||||
seen := map[T]bool{}
|
||||
seen[empty] = true
|
||||
for _, item := range inlist {
|
||||
if _, ok := keys[item]; !ok {
|
||||
keys[item] = true
|
||||
if _, ok := seen[item]; !ok {
|
||||
seen[item] = true
|
||||
list = append(list, item)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue