Codebase list golang-pty / 371d7f64-f83c-46c3-894f-46c2f95e6b9b/main mktypes.bash
371d7f64-f83c-46c3-894f-46c2f95e6b9b/main

Tree @371d7f64-f83c-46c3-894f-46c2f95e6b9b/main (Download .tar.gz)

mktypes.bash @371d7f64-f83c-46c3-894f-46c2f95e6b9b/mainraw · history · blame

#!/usr/bin/env bash

GOOSARCH="${GOOS}_${GOARCH}"
case "$GOOSARCH" in
_* | *_ | _)
	echo 'undefined $GOOS_$GOARCH:' "$GOOSARCH" 1>&2
	exit 1
	;;
esac

GODEFS="go tool cgo -godefs"

$GODEFS types.go |gofmt > ztypes_$GOARCH.go

case $GOOS in
freebsd|dragonfly|openbsd)
	$GODEFS types_$GOOS.go |gofmt > ztypes_$GOOSARCH.go
	;;
esac