diff options
| author | copilot-swe-agent[bot] <[email protected]> | 2026-04-28 18:24:00 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-04-28 18:24:00 +0000 |
| commit | 8834c0be63ee88e0ad23fe621d5f5fe344b32089 (patch) | |
| tree | 49029d2fd927e8832d05420d1bf1cf850aa22325 /merge.go | |
| parent | 4f125e579472e5ed87fd052ef68ab80f5fe679b0 (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.go | 36 |
1 files changed, 13 insertions, 23 deletions
@@ -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) } } |
