Instructions for Compiling the WASM Program
1 minute read
Initialize a new Golang project using the following command:
mkdir go-filter && go mod init go-filterCopy the above Golang program in a file called filter.go
With our filter program written, lets compile it using tinygo
# Use the below command for tinygo version >= 0.33.0 tinygo build -target=wasi -o filter.wasm filter.go # Use the below command for tinygo version < 0.33.0 tinygo build -wasm-abi=generic -target=wasi -o filter.wasm filter.goIt will produce a file called filter.wasm. This compiled WASM file will be used by Fluent Bit to execute the plugin.