...
1#!/bin/bash
2
3set -euo pipefail
4export GO111MODULE=on
5gqlgen_dir=$(pwd)
6cd $(mktemp -d)
7go mod init inittest
8printf '// +build tools\npackage tools\nimport _ "github.com/99designs/gqlgen"' | gofmt > tools.go
9go mod tidy
10go mod edit -replace=github.com/99designs/gqlgen="$gqlgen_dir"
11go mod tidy
12
13if ! go run github.com/99designs/gqlgen init ; then
14 echo "gqlgen init failed"
15 exit 125
16fi
17
18if ! go run github.com/99designs/gqlgen generate ; then
19 echo "gqlgen generate failed"
20 exit 125
21fi
View as plain text