all: fix some function names and typos in comment
Change-Id: I8066b22cb87e09fb160de3b8ff2d8fdde6ec3dcf Reviewed-on: https://go-review.googlesource.com/c/tools/+/675815 Reviewed-by: David Chase <drchase@google.com> Auto-Submit: Alan Donovan <adonovan@google.com> Reviewed-by: Alan Donovan <adonovan@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
8962b38ba5
commit
b7d1ec0604
2 changed files with 11 additions and 11 deletions
|
|
@ -25,7 +25,7 @@ func main() {
|
|||
// Create a server with a single tool.
|
||||
server := mcp.NewServer("greeter", "v1.0.0", nil)
|
||||
server.AddTools(mcp.NewTool("greet", "say hi", SayHi))
|
||||
// Run the server over stdin/stdout, until the client diconnects
|
||||
// Run the server over stdin/stdout, until the client disconnects
|
||||
_ = server.Run(context.Background(), mcp.NewStdIOTransport())
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import (
|
|||
|
||||
// Helpers below are copied from gopls' moremaps package.
|
||||
|
||||
// sorted returns an iterator over the entries of m in key order.
|
||||
// Sorted returns an iterator over the entries of m in key order.
|
||||
func Sorted[M ~map[K]V, K cmp.Ordered, V any](m M) iter.Seq2[K, V] {
|
||||
// TODO(adonovan): use maps.Sorted if proposal #68598 is accepted.
|
||||
return func(yield func(K, V) bool) {
|
||||
|
|
@ -26,7 +26,7 @@ func Sorted[M ~map[K]V, K cmp.Ordered, V any](m M) iter.Seq2[K, V] {
|
|||
}
|
||||
}
|
||||
|
||||
// keySlice returns the keys of the map M, like slices.Collect(maps.Keys(m)).
|
||||
// KeySlice returns the keys of the map M, like slices.Collect(maps.Keys(m)).
|
||||
func KeySlice[M ~map[K]V, K comparable, V any](m M) []K {
|
||||
r := make([]K, 0, len(m))
|
||||
for k := range m {
|
||||
|
|
|
|||
Loading…
Reference in a new issue