summaryrefslogtreecommitdiff
path: root/merge.go
diff options
context:
space:
mode:
authorcopilot-swe-agent[bot] <[email protected]>2026-03-09 06:35:47 +0000
committercopilot-swe-agent[bot] <[email protected]>2026-03-09 06:35:47 +0000
commit2600825c50d7e7f2b4427674f1aefca270bcca27 (patch)
tree18f216c6af28fd3975a0665d75ccf7b5c0078cb6 /merge.go
parent5a14eb90f575b983aa407341af91aa7654e65f12 (diff)
Refactor: all plugin subdirectories use option patterncopilot/modify-plugin-files-subdirectories
Apply the same functional options pattern from plugin/singbox to: - plugin/mihomo (mrs_in.go, mrs_out.go) - plugin/plaintext (text_in.go, common_in.go, common_out.go, text_out.go, clash_in.go, clash_out.go, json_in.go, surge_in.go, surge_out.go) - plugin/maxmind (all input/output files) - plugin/v2ray (dat_in.go, dat_out.go) - plugin/special (cutter.go, lookup.go, private.go, stdin.go, stdout.go) - lookup.go and merge.go updated to use new constructors Co-authored-by: Loyalsoldier <[email protected]>
Diffstat (limited to 'merge.go')
-rw-r--r--merge.go38
1 files changed, 15 insertions, 23 deletions
diff --git a/merge.go b/merge.go
index 8e8108ed..58cbc7e5 100644
--- a/merge.go
+++ b/merge.go
@@ -41,38 +41,30 @@ 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,
+ )
}
}