1DOLLY 72PACKAGE go3REQUIRES HOST runtime@045REQUIRES HOST http@0678910111213FROM /v0.1.4/demos/go/Dollyfile-go-sdk 33104d7b1d04d22e554cbe5ad917ccde932c943ca879a6e61e054a16bbfe895b14REQUIRES TOOL go15SLOP mkdir -p /tmp/seed16SLOP cp -R /usr/lib/go/pkg/tool/dolly_wasm64 /tmp/seed/tool17SLOP cp -R /usr/lib/go/bin /tmp/seed/bin1819202122SLOP CWD /usr/lib/go/src CGO_ENABLED=0 GOCACHE=/tmp/go-cache GOMEMLIMIT=2GiB GOFLAGS='-trimpath -ldflags=-w -gcflags=cmd/...=-dwarf=false' go install -a -p 2 cmd/go cmd/gofmt cmd/asm cmd/cgo cmd/compile cmd/cover cmd/fix cmd/link cmd/preprofile cmd/vet2324FILE /tmp/same/main.go25 // Fails unless each file of the first directory is, byte for byte, the26 // file of its name in the second.27 package main28 29 import (30 "bytes"31 "fmt"32 "os"33 "path/filepath"34 )35 36 func main() {37 entries, err := os.ReadDir(os.Args[1])38 if err != nil {39 panic(err)40 }41 for _, entry := range entries {42 seed, seedErr := os.ReadFile(filepath.Join(os.Args[1], entry.Name()))43 built, builtErr := os.ReadFile(filepath.Join(os.Args[2], entry.Name()))44 if seedErr != nil || builtErr != nil || !bytes.Equal(seed, built) {45 fmt.Fprintf(os.Stderr, "%s is not the seed's\n", entry.Name())46 os.Exit(1)47 }48 }49 fmt.Printf("%d programs equal the seed's\n", len(entries))50 }51SLOP GOCACHE=/tmp/go-cache go run /tmp/same/main.go /tmp/seed/tool /usr/lib/go/pkg/tool/dolly_wasm6452SLOP GOCACHE=/tmp/go-cache go run /tmp/same/main.go /tmp/seed/bin /usr/lib/go/bin53SLOP go version545556FILE /usr/bin/go5758 /usr/lib/go/bin/go "$@"59FILE /usr/bin/gofmt6061 /usr/lib/go/bin/gofmt "$@"62EXPORTS TOOL go63EXPORTS TOOL gofmt6465EXPORTS ENV GOTOOLCHAIN local666768EXPORTS ENV GOFLAGS -p=469EXPORTS FOLDER go-root /usr/lib/go70FILE /usr/share/man/cat1/go.171 go: the Go toolchain (Go 1.27.3) for GOOS=dolly GOARCH=wasm64, built inside72 Dolly from its pinned sources.73 74 go build compiles a package and its dependencies75 go run main.go compiles and runs a program76 gofmt -l . lists files whose formatting differs77 78 Programs are pure Go: there is no cgo, and they run single-threaded.79 go builds four packages at a time (GOFLAGS=-p=4).80 net/http goes through the page's HTTP broker (its policy, and CORS), so81 go get works with proxy.golang.org; net's sockets reach nothing.82 signal.Notify receives the kernel's signals; syscall.Exec replaces the83 program. Upstream's documentation: https://go.dev/doc/84