Remove merge package, move Merge to input

This commit is contained in:
AI Bot
2026-05-03 14:30:16 +02:00
committed by Riyyi
parent 5ad29767c9
commit c4746697b5
4 changed files with 15 additions and 19 deletions
+14
View File
@@ -2,11 +2,25 @@ package input
import (
"bufio"
"errors"
"os"
"path/filepath"
"strings"
)
var ErrEmptyList = errors.New("package list is empty")
func Merge(packages map[string]bool) ([]string, error) {
result := make([]string, 0, len(packages))
for name := range packages {
result = append(result, name)
}
if len(result) == 0 {
return nil, ErrEmptyList
}
return result, nil
}
func ReadPackages(stateFiles []string) (map[string]bool, error) {
packages := make(map[string]bool)
-16
View File
@@ -1,16 +0,0 @@
package merge
import "errors"
var ErrEmptyList = errors.New("package list is empty")
func Merge(packages map[string]bool) ([]string, error) {
result := make([]string, 0, len(packages))
for name := range packages {
result = append(result, name)
}
if len(result) == 0 {
return nil, ErrEmptyList
}
return result, nil
}