Skip to content

Commit

Permalink
Merge pull request #21 from ViaQ/fix-bingo
Browse files Browse the repository at this point in the history
Update bingo configuration for Go 1.17
  • Loading branch information
periklis authored Mar 30, 2022
2 parents 81c1ed0 + 7d88664 commit 5ea5a34
Show file tree
Hide file tree
Showing 7 changed files with 663 additions and 16 deletions.
1 change: 1 addition & 0 deletions .bingo/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# But not these files:
!.gitignore
!*.mod
!*.sum
!README.md
!Variables.mk
!variables.env
Expand Down
3 changes: 2 additions & 1 deletion .bingo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ This is directory which stores Go modules with pinned buildable package that is
* Run `bingo get` to install all tools having each own module file in this directory.
* Run `bingo get <tool>` to install <tool> that have own module file in this directory.
* For Makefile: Make sure to put `include .bingo/Variables.mk` in your Makefile, then use $(<upper case tool name>) variable where <tool> is the .bingo/<tool>.mod.
* For shell: Run `source .bingo/variables.env` to source all environment variable for each tool
* For shell: Run `source .bingo/variables.env` to source all environment variable for each tool.
* For go: Import `.bingo/variables.go` to for variable names.
* See https://github.com/bwplotka/bingo or -h on how to add, remove or change binaries dependencies.

## Requirements
Expand Down
13 changes: 7 additions & 6 deletions .bingo/Variables.mk
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.2.2. DO NOT EDIT.
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.5.2. DO NOT EDIT.
# All tools are designed to be build inside $GOBIN.
BINGO_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
GOPATH ?= $(shell go env GOPATH)
GOBIN ?= $(firstword $(subst :, ,${GOPATH}))/bin
GO ?= $(shell which go)

# Bellow generated variables ensure that every time a tool under each variable is invoked, the correct version
# Below generated variables ensure that every time a tool under each variable is invoked, the correct version
# will be used; reinstalling only if needed.
# For example for golangci-lint variable:
#
Expand All @@ -16,9 +17,9 @@ GO ?= $(shell which go)
# @echo "Running golangci-lint"
# @$(GOLANGCI_LINT) <flags/args..>
#
GOLANGCI_LINT := $(GOBIN)/golangci-lint-v1.31.0
$(GOLANGCI_LINT): .bingo/golangci-lint.mod
GOLANGCI_LINT := $(GOBIN)/golangci-lint-v1.32.2
$(GOLANGCI_LINT): $(BINGO_DIR)/golangci-lint.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/golangci-lint-v1.31.0"
@cd .bingo && $(GO) build -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.31.0 "github.com/golangci/golangci-lint/cmd/golangci-lint"
@echo "(re)installing $(GOBIN)/golangci-lint-v1.32.2"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.32.2 "github.com/golangci/golangci-lint/cmd/golangci-lint"

4 changes: 1 addition & 3 deletions .bingo/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
module _ // Fake go.mod auto-created by 'bingo' for go -moddir compatibility with non-Go projects. Commit this file, together with other .mod files.

go 1.13
module _ // Fake go.mod auto-created by 'bingo' for go -moddir compatibility with non-Go projects. Commit this file, together with other .mod files.
2 changes: 1 addition & 1 deletion .bingo/golangci-lint.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.15

require github.com/golangci/golangci-lint v1.31.0 // cmd/golangci-lint
require github.com/golangci/golangci-lint v1.32.2 // cmd/golangci-lint
646 changes: 646 additions & 0 deletions .bingo/golangci-lint.sum

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions .bingo/variables.env
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.2.2. DO NOT EDIT.
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.5.2. DO NOT EDIT.
# All tools are designed to be build inside $GOBIN.
# Those variables will work only until 'bingo get' was invoked, or if tools were installed via Makefile's Variables.mk.
local gobin=$(go env GOBIN)
GOBIN=${GOBIN:=$(go env GOBIN)}

if [ -z "$gobin" ]; then
gobin="$(go env GOPATH)/bin"
if [ -z "$GOBIN" ]; then
GOBIN="$(go env GOPATH)/bin"
fi


GOLANGCI_LINT="${gobin}/golangci-lint-v1.31.0"
GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.32.2"

0 comments on commit 5ea5a34

Please sign in to comment.