Skip to content

Commit 0596f6f

Browse files
committed
forcing a go.mod-based build check
1 parent 98437c7 commit 0596f6f

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,14 @@ build: $(BUILD)/fmt ## ensure all packages build
278278
go build ./...
279279
$Q # caution: some errors are reported on stdout for some reason
280280
go test -exec true ./... >/dev/null
281+
$Q # compare the current go version with what is in go.mod, and get `{gomod_version}.1` or similar and ensure it builds.
282+
$Q GOVERSION="$(shell go env GOVERSION | cut -d. -f1-2)" \
283+
MODVERSION="go$(shell grep '^go 1' go.mod | cut -d' ' -f2)"; \
284+
if [[ "$$GOVERSION" != "$$MODVERSION" ]]; then \
285+
echo "go.mod version \"$$MODVERSION\" is not the same as current go version \"$$GOVERSION\", making sure it builds..."; \
286+
echo GOTOOLCHAIN="$$MODVERSION".1 go build ./...; \
287+
GOTOOLCHAIN="$$MODVERSION".1 go build ./...; \
288+
fi
281289

282290
.PHONY: lint
283291
# useful to actually re-run to get output again.

workflow/workflow.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,13 @@
2121
package workflow
2222

2323
import (
24-
"fmt"
25-
2624
"github.com/uber-go/tally"
2725
"go.uber.org/zap"
2826

2927
"go.uber.org/cadence/encoded"
3028
"go.uber.org/cadence/internal"
31-
32-
"testing"
33-
"weak"
3429
)
3530

36-
func init() {
37-
var s string
38-
sp := weak.Make(&s)
39-
fmt.Println(sp)
40-
41-
_ = (&testing.T{}).Context()
42-
}
43-
4431
type (
4532

4633
// ChildWorkflowFuture represents the result of a child workflow execution

0 commit comments

Comments
 (0)