d daedalus

Go

Go Applications

Package Go applications into self-extracting binaries. daedalus builds your Go code into a static binary and packages it.

Detection

daedalus detects Go applications by looking for go.mod in the project root.

How It Works

  1. Detects go.mod in the project directory
  2. Builds the Go binary using go build
  3. Packages the static binary into the .de format
  4. No interpreter needed at runtime — pure native execution

Requirements

  • Go 1.21+ installed and available on PATH
  • go.mod file in the project root

Example

# Create a simple Go app
mkdir my-go-app && cd my-go-app

go mod init my-go-app

cat > main.go << 'EOF'
package main

import (
    "fmt"
    "net/http"
)

func main() {
    http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
        fmt.Fprintf(w, "Hello from Go!")
    })
    http.ListenAndServe(":8080", nil)
}
EOF

# Build the .de
daedalus build . -o my-go-app.de

# Run it
./my-go-app.de

Cross-Compilation

Go has excellent cross-compilation support. You can build for different architectures:

# Build for Linux aarch64 from x86_64
GOOS=linux GOARCH=arm64 daedalus build . -o my-go-app-arm64.de

# Build for macOS from Linux
GOOS=darwin GOARCH=arm64 daedalus build . -o my-go-app-macos.de

Notes

  • Go produces static binaries, so no runtime dependencies are needed
  • CGO_ENABLED=0 is recommended for fully static builds
  • The resulting .de will be larger than the Go binary alone due to the launcher