summaryrefslogtreecommitdiff
path: root/merge.go
diff options
context:
space:
mode:
authorcopilot-swe-agent[bot] <[email protected]>2026-04-28 18:24:00 +0000
committerGitHub <[email protected]>2026-04-28 18:24:00 +0000
commit8834c0be63ee88e0ad23fe621d5f5fe344b32089 (patch)
tree49029d2fd927e8832d05420d1bf1cf850aa22325 /merge.go
parent4f125e579472e5ed87fd052ef68ab80f5fe679b0 (diff)
Refactor all plugins to use functional options patterncopilot/refactor-plugins-functional-options
Agent-Logs-Url: https://github.com/Loyalsoldier/geoip/sessions/e2b66c9a-3d01-490c-9b31-32109cfe4feb Co-authored-by: Loyalsoldier <[email protected]>
Diffstat (limited to 'merge.go')
-rw-r--r--merge.go36
1 files changed, 13 insertions, 23 deletions
diff --git a/merge.go b/merge.go
index 8e8108ed..4856c454 100644
--- a/merge.go
+++ b/merge.go
@@ -41,38 +41,28 @@ var mergeCmd = &cobra.Command{
}
func getInputForMerge() lib.InputConverter {
- return &special.Stdin{
- Type: special.TypeStdin,
- Action: lib.ActionAdd,
- Description: special.DescStdin,
- Name: "temp",
- }
+ return special.NewStdin(
+ lib.ActionAdd,
+ special.WithStdinName("temp"),
+ )
}
func getOutputForMerge(otype string) lib.OutputConverter {
switch lib.IPType(otype) {
case lib.IPv4:
- return &special.Stdout{
- Type: special.TypeStdout,
- Action: lib.ActionOutput,
- Description: special.DescStdout,
- OnlyIPType: lib.IPv4,
- }
+ return special.NewStdout(
+ lib.ActionOutput,
+ special.WithStdoutOnlyIPType(lib.IPv4),
+ )
case lib.IPv6:
- return &special.Stdout{
- Type: special.TypeStdout,
- Action: lib.ActionOutput,
- Description: special.DescStdout,
- OnlyIPType: lib.IPv6,
- }
+ return special.NewStdout(
+ lib.ActionOutput,
+ special.WithStdoutOnlyIPType(lib.IPv6),
+ )
default:
- return &special.Stdout{
- Type: special.TypeStdout,
- Action: lib.ActionOutput,
- Description: special.DescStdout,
- }
+ return special.NewStdout(lib.ActionOutput)
}
}