Skip to content

Commit 872b437

Browse files
committed
internal/readme: use go:generate rather than Make
Simplify the readme generation to just use go:generate, no longer depending on Make or bash. Subsequent CLs will generate more documentation in a similar manner. For #442
1 parent 3a66cf3 commit 872b437

File tree

5 files changed

+12
-47
lines changed

5 files changed

+12
-47
lines changed

.github/workflows/readme-check.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,13 @@ jobs:
1919
uses: actions/checkout@v4
2020
- name: Check README is up-to-date
2121
run: |
22-
cd internal/readme
23-
make
22+
go generate ./internal/readme
2423
if [ -n "$(git status --porcelain)" ]; then
2524
echo "ERROR: README.md is not up-to-date!"
2625
echo ""
27-
echo "The README.md file differs from what would be generated by running 'make' in internal/readme/."
26+
echo "The README.md file differs from what would be generated by `go generate ./internal/readme`."
2827
echo "Please update internal/readme/README.src.md instead of README.md directly,"
29-
echo "then run 'make' in the internal/readme/ directory to regenerate README.md."
28+
echo "then run `go generate ./internal/readme` to regenerate README.md."
3029
echo ""
3130
echo "Changes:"
3231
git status --porcelain

internal/readme/Makefile

Lines changed: 0 additions & 19 deletions
This file was deleted.

internal/readme/build.sh

Lines changed: 0 additions & 22 deletions
This file was deleted.

internal/readme/doc.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Copyright 2025 The Go MCP SDK Authors. All rights reserved.
2+
// Use of this source code is governed by an MIT-style
3+
// license that can be found in the LICENSE file.
4+
5+
//go:generate go run golang.org/x/example/internal/cmd/weave@latest -o ../../README.md ./README.src.md
6+
7+
// The readme package is used to generate README.md at the top-level of this
8+
// repo. Regenerate the README with go generate.
9+
package readme

mcp/mcp.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by an MIT-style
33
// license that can be found in the LICENSE file.
44

5-
//go:generate ../internal/readme/build.sh
6-
75
// The mcp package provides an SDK for writing model context protocol clients
86
// and servers.
97
//

0 commit comments

Comments
 (0)