Help us shape the future of Go! Take the 2026 Go Developer Survey

sdk

command
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Command sdk writes the public sdk package's generated files from the engine: sdk/sdk_gen.go, the functions, constants and variables an embedding caller uses, and sdk/types_gen.go, a type alias for every engine type that caller has to be able to name.

The engine lives under internal/, so a caller outside this module cannot import it. The sdk package re-exports the embedding surface. Which declarations that is, is marked where they are declared: an `//sdk:export` line in a declaration's doc comment exports it, and `//sdk:export Name` exports it under another name. On a const or var block the directive exports every name in the block; on one spec inside a block it exports only that spec. The doc comment, without the directive, becomes the sdk's doc.

Functions become one-line wrappers rather than variables, so the sdk's documentation lists them as functions, and generic ones keep their type parameters. Types are aliases rather than copies, so a value built through sdk is the engine's own value. Beyond the exported types, every registered task and every named engine type reachable from an exported type, function signature or constant through exported fields is aliased too: writing that list by hand would miss the next task someone adds, so it is derived here, and TestGeneratedSDKIsCurrent fails when a committed file falls behind.

Because the surface is generated, a rebase that conflicts in either file is settled by regenerating it.

It is run by `go generate` from the sdk directory, which is where the output is written.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL