← Demos
Getting started
Write an extension in Go
pig extension init creates a Go extension; pig -e builds and loads it.
What you are seeing
- pig extension init ./hello --lang go creates two files: extension.go and go.mod.
- pig -e ./hello builds the extension (pig builds Go extensions on first use) and loads it. The wait for the build is shown at 4x speed.
- The extension adds a /hello command. Running it prints the extension's reply.
Try it yourself
Create a Go extension
pig extension init ./hello --lang goLoad it
pig -e ./hello
Files: MP4 · WebM · Captions (VTT) · PiG source