github.com/zyedidia/knit@v1.1.2-0.20230901152954-f7d4e39a0e24/examples/go/Knitfile (about) 1 local flags := -trimpath -ldflags "-s -w" 2 local name := hello 3 4 local systems = { 5 f"$name-linux-amd64", 6 f"$name-linux-386", 7 f"$name-linux-arm", 8 f"$name-linux-arm64", 9 f"$name-darwin-amd64", 10 f"$name-darwin-arm64", 11 f"$name-openbsd-amd64", 12 f"$name-freebsd-amd64", 13 f"$name-windows-amd64", 14 } 15 16 return b{ 17 $ build:VB: $name 18 19 $ $name:B: 20 go build $flags 21 22 $ install:VB: 23 go install $flags 24 25 $ all:V: $systems 26 27 $ ($name-(.*)-(.*)):R: 28 GOOS=$match2 GOARCH=$match3 go build $flags -o $match1 29 30 $ test:VB: 31 go test 32 33 $ cover.out:B: 34 go test -coverprofile cover.out 35 36 $ cover-html:VB: cover.out 37 go tool cover -html=$input 38 39 $ cover:VB: 40 go test -cover 41 42 $ clean:VBQ: 43 knit :all -t clean 44 }