From 52b4c44db3e17dbb643ab97998764787d2d7424f Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Wed, 19 Nov 2025 19:43:42 -0500 Subject: [PATCH] examples: Add go:generate directives to generate protcol.go files --- examples/chat/doc.go | 10 +++++----- examples/ping/doc.go | 6 ++++++ 2 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 examples/ping/doc.go diff --git a/examples/chat/doc.go b/examples/chat/doc.go index 9fff5a7..eccae07 100644 --- a/examples/chat/doc.go +++ b/examples/chat/doc.go @@ -1,6 +1,6 @@ -// Package chat implements a simple chat protocol over HOPP. To re-generate the -// 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 demonstrates a simple chat protocol. 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 diff --git a/examples/ping/doc.go b/examples/ping/doc.go new file mode 100644 index 0000000..e790642 --- /dev/null +++ b/examples/ping/doc.go @@ -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