Fail build when golang version doesn't match (#1734)
This commit is contained in:
parent
64dc40cf4c
commit
d6be9672f8
3 changed files with 15 additions and 0 deletions
1
main.go
1
main.go
|
|
@ -8,6 +8,7 @@ import (
|
|||
|
||||
"github.com/evcc-io/evcc/cmd"
|
||||
"github.com/evcc-io/evcc/server"
|
||||
_ "github.com/evcc-io/evcc/util/goversion" // require minimum go version
|
||||
)
|
||||
|
||||
//go:embed dist
|
||||
|
|
|
|||
8
util/goversion/constraint.go
Normal file
8
util/goversion/constraint.go
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
// Approach from https://github.com/theckman/goconstraint/
|
||||
|
||||
// Package goversion should only be used as a blank import. If imported, it
|
||||
// will only compile if the Go runtime version is >= 1.16.
|
||||
package goversion
|
||||
|
||||
// This will fail to compile if the Go runtime version isn't >= 1.16.
|
||||
var _ = __EVCC_REQUIRES_GO_VERSION_1_16__
|
||||
6
util/goversion/version.go
Normal file
6
util/goversion/version.go
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
//go:build go1.16
|
||||
// +build go1.16
|
||||
|
||||
package goversion
|
||||
|
||||
const __EVCC_REQUIRES_GO_VERSION_1_16__ = uint8(0)
|
||||
Loading…
Add table
Add a link
Reference in a new issue