Files
shell-scripts/tests/validate.sh
T
andrew 30c4288a16 Squashed 'golang-install/' content from commit 258f94f
git-subtree-dir: golang-install
git-subtree-split: 258f94f6120bbf99f4c9133c9ab5826dcd359fbe
2022-05-05 20:07:21 +00:00

24 lines
374 B
Bash

#!/bin/bash
set -e
mkdir -p "/tmp/validate-go"
pushd "/tmp/validate-go"
go mod init example.com/user/hello
cat >hello.go <<EOF
package main
import (
"fmt"
"runtime"
)
func main() {
fmt.Printf("go version %s %s/%s\n", runtime.Version(), runtime.GOOS, runtime.GOARCH)
}
EOF
echo "Building hello test project"
go build
echo "Run hello test project"
./hello
popd