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

gen

command
v1.3.104 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package main reads ../../services-config.json and emits Go-literal declarations for deployment.Prod and deployment.ProdConf into ../../data_static.go.

Why a generator: the deployment package's runtime init() invokes encoding/json on the embedded services-config.json to populate those four vars. TinyGo 0.41.1's stdlib doesn't ship the reflect runtime helpers (reflect.unsafe_New, reflect.mapassign, etc.) that encoding/json needs, so the import was blocking TinyGo compilation of the install-page WASM (pkg/skywireconfig/genvisor + autoconfigcmd). The split is:

  • config.go struct defs, var declarations.
  • config_native.go (!js) json.Unmarshal-based init for non-WASM builds, with SKYDEPLOY override support.
  • config_static.go (tinygo, js) init that copies from data_static.go.
  • data_static.go (tinygo, js) static Go literals, generated here.

Lives under deployment/cmd/gen (not deployment/internal/gen) per project convention against `internal/` packages — those break out-of-tree test infrastructure that imports skywire from vendor.

Run via `go generate ./deployment/` or directly:

cd deployment/cmd/gen && go run .

Jump to

Keyboard shortcuts

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