Skip to content

Commit 86d1a1d

Browse files
committed
Remove cruft
1 parent a989fce commit 86d1a1d

File tree

1 file changed

+4
-28
lines changed

1 file changed

+4
-28
lines changed

codegen/example/example_client.go

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,8 @@ func exampleCLIMain(_ string, root *expr.RootExpr, svr *expr.ServerExpr) *codege
6868
"Root": root,
6969
},
7070
FuncMap: map[string]any{
71-
"join": strings.Join,
72-
"toUpper": strings.ToUpper,
73-
"hasJSONRPC": func() bool { return hasJSONRPCServices(root, svr) },
74-
"hasHTTP": func() bool { return hasHTTPServices(root, svr) },
71+
"join": strings.Join,
72+
"toUpper": strings.ToUpper,
7573
},
7674
}, {
7775
Name: "cli-main-end",
@@ -84,32 +82,10 @@ func exampleCLIMain(_ string, root *expr.RootExpr, svr *expr.ServerExpr) *codege
8482
"Server": svrdata,
8583
},
8684
FuncMap: map[string]any{
87-
"toUpper": strings.ToUpper,
88-
"join": strings.Join,
89-
"hasJSONRPC": func() bool { return hasJSONRPCServices(root, svr) },
90-
"hasHTTP": func() bool { return hasHTTPServices(root, svr) },
85+
"toUpper": strings.ToUpper,
86+
"join": strings.Join,
9187
},
9288
},
9389
}
9490
return &codegen.File{Path: path, SectionTemplates: sections, SkipExist: true}
9591
}
96-
97-
// hasJSONRPCServices checks if the given server has any JSON-RPC services.
98-
func hasJSONRPCServices(root *expr.RootExpr, svr *expr.ServerExpr) bool {
99-
for _, svcName := range svr.Services {
100-
if root.API.JSONRPC.Service(svcName) != nil {
101-
return true
102-
}
103-
}
104-
return false
105-
}
106-
107-
// hasHTTPServices checks if the given server has any HTTP services (not including JSON-RPC).
108-
func hasHTTPServices(root *expr.RootExpr, svr *expr.ServerExpr) bool {
109-
for _, svcName := range svr.Services {
110-
if root.API.HTTP.Service(svcName) != nil {
111-
return true
112-
}
113-
}
114-
return false
115-
}

0 commit comments

Comments
 (0)