taubyte-go-sdk-constraints
Installation
SKILL.md
Go SDK Constraints
Use this skill for any Go function implementation or debugging.
Go function filesystem layout (non-negotiable)
- Authoring layout: after
tau new function --template empty --language Go, all hand-written Go for the function lives inempty.goat the function root — the same directory asgo.mod(e.g.code/functions/<name>/empty.go). Do not putempty.gounderlib/or any subdirectory for source you maintain. - Never manually create
lib/, never move or copyempty.gointolib/, and never hand-authormain.go(or any extra.goshims) in the function tree to “fix” the build. That pattern duplicates packages, confuses the WASM layout, and breakstau build function/ CI (e.g. found packages lib and main in/src/lib). - Do not “normalize” the tree: no merging a second
main.gounderlib/, no relocating the scaffold out of the root. - If
tau build functionor a local experiment once droppedmain.goor alib/tree into the repo, treat those as mistakes or stale artifacts when they contradict the root-empty.gorule: remove straylib/and hand-curatedmain.go, keep only rootempty.go(+go.mod/.taubyte/*as generated). Do not recreatelib/to satisfy the compiler.
Local WASM build test (preferred over ad-hoc tau build tree hacks)
From the function root (directory containing empty.go and go.mod), with Docker available, use taubyte/go-wasi so the official /utils/wasm.sh path runs against a clean /src copy — not by adding lib/ or main.go locally.