Squashed 'golang-install/' content from commit 258f94f

git-subtree-dir: golang-install
git-subtree-split: 258f94f6120bbf99f4c9133c9ab5826dcd359fbe
This commit is contained in:
2022-05-05 20:07:21 +00:00
commit 30c4288a16
10 changed files with 513 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
#!/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