Skip to content

Commit 007aa08

Browse files
committed
webrpc now supports -target=json
1 parent 9b175b0 commit 007aa08

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

cmd/gospeak/main.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,11 @@ func main() {
3333
}
3434

3535
if len(targets) == 0 {
36-
fmt.Fprintf(os.Stderr, "no interfaces with //go:webrpc found, see https://github.com/golang-cz/gospeak\n")
36+
fmt.Fprintf(os.Stderr, "no interface has //go:webrpc directive, see https://github.com/golang-cz/gospeak\n")
3737
os.Exit(1)
3838
}
3939

4040
for _, target := range targets {
41-
if target.Generator == "json" {
42-
jsonSchema, _ := target.Schema.ToJSON()
43-
if err := os.WriteFile(target.OutFile, []byte(jsonSchema), 0644); err != nil {
44-
fmt.Fprintf(os.Stderr, "failed to write to %q file: %v\n", target.OutFile, err)
45-
os.Exit(1)
46-
}
47-
fmt.Printf("%20v => %v ✓\n", target.InterfaceName, target.OutFile)
48-
continue
49-
}
50-
5141
config := &gen.Config{
5242
RefreshCache: false,
5343
Format: false,

0 commit comments

Comments
 (0)