examples: Add go:generate directives to generate protcol.go files

This commit is contained in:
Sasha Koshka 2025-11-19 19:43:42 -05:00
parent 11e972c696
commit 52b4c44db3
2 changed files with 11 additions and 5 deletions

View File

@ -1,6 +1,6 @@
// Package chat implements a simple chat protocol over HOPP. To re-generate the // Package chat demonstrates a simple chat protocol.
// source files, run this command from within the root directory of the
// repository:
//
// go run ./cmd/hopp-generate examples/chat/protocol.pdl -o examples/chat/protocol/protocol.go
package chat package chat
// To use this in your own project, replace "go run ../../cmd/hopp-generate"
// with just "hopp-generate".
//go:generate go run ../../cmd/hopp-generate protocol.pdl -o protocol.go

6
examples/ping/doc.go Normal file
View File

@ -0,0 +1,6 @@
// Example ping demonstrates a simple ping/pong protocol.
package ping
// To use this in your own project, replace "go run ../../cmd/hopp-generate"
// with just "hopp-generate".
//go:generate go run ../../cmd/hopp-generate protocol.pdl -o protocol.go