mirror of https://github.com/perkeep/perkeep.git
New pkg/depcheck package to check Go version.
Based on kr's example (syntantically valid Go code, to make cmd/go happy, but will fail to compile and include the failure text) Change-Id: I11f9eeabf6bf2c77055752014c71183b7eb7b23a
This commit is contained in:
parent
ae097a3960
commit
b38077ff0f
|
@ -26,6 +26,11 @@ import (
|
|||
"reflect"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
// This is a pretty low-level package, so add the Go minimum
|
||||
// version dependency check here at least. This avoids
|
||||
// adding it in many other places.
|
||||
_ "camlistore.org/pkg/depcheck"
|
||||
)
|
||||
|
||||
// Pattern is the regular expression which matches a blobref.
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
Copyright 2014 The Camlistore Authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package depcheck does nothing except for fail to build when
|
||||
// the system's version of Go is too old.
|
||||
package depcheck
|
|
@ -0,0 +1,28 @@
|
|||
// +build !go1.3
|
||||
|
||||
/*
|
||||
Copyright 2014 The Camlistore Authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package depcheck
|
||||
|
||||
import `
|
||||
|
||||
****************************************************************************
|
||||
|
||||
Camlistore requires Go 1.3 or later.
|
||||
|
||||
****************************************************************************
|
||||
`
|
Loading…
Reference in New Issue