vendor: revendor

This commit is contained in:
Sergiusz Urbaniak 2020-12-14 12:43:28 +01:00
parent 269295a414
commit 9f0440be0f
No known key found for this signature in database
GPG key ID: 44E6612519E13C39
669 changed files with 58447 additions and 20021 deletions

20
vendor/k8s.io/gengo/parser/parse.go generated vendored
View file

@ -20,6 +20,7 @@ import (
"fmt"
"go/ast"
"go/build"
"go/constant"
"go/parser"
"go/token"
tc "go/types"
@ -335,7 +336,8 @@ func (b *Builder) addDir(dir string, userRequested bool) error {
return nil
}
var regexErrPackageNotFound = regexp.MustCompile(`^unable to import ".*?": cannot find package ".*?" in any of:`)
// regexErrPackageNotFound helps test the expected error for not finding a package.
var regexErrPackageNotFound = regexp.MustCompile(`^unable to import ".*?":.*`)
func isErrPackageNotFound(err error) bool {
return regexErrPackageNotFound.MatchString(err.Error())
@ -847,6 +849,22 @@ func (b *Builder) addConstant(u types.Universe, useName *types.Name, in *tc.Cons
out := u.Constant(name)
out.Kind = types.DeclarationOf
out.Underlying = b.walkType(u, nil, in.Type())
var constval string
// For strings, we use `StringVal()` to get the un-truncated,
// un-quoted string. For other values, `.String()` is preferable to
// get something relatively human readable (especially since for
// floating point types, `ExactString()` will generate numeric
// expressions using `big.(*Float).Text()`.
switch in.Val().Kind() {
case constant.String:
constval = constant.StringVal(in.Val())
default:
constval = in.Val().String()
}
out.ConstValue = &constval
return out
}