Codebase list golang-github-creack-pty / 14bb5e4d-635c-4b44-9a9f-4e4c24d81726/main mktypes.bash
14bb5e4d-635c-4b44-9a9f-4e4c24d81726/main

Tree @14bb5e4d-635c-4b44-9a9f-4e4c24d81726/main (Download .tar.gz)

mktypes.bash @14bb5e4d-635c-4b44-9a9f-4e4c24d81726/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