Minor cleanup + kokoro ubuntu fix (#86)
* tools: Minor clean up of protocol_gen.go * Fix kokoro/ubuntu builds
This commit is contained in:
parent
87f8b4a06b
commit
8a320f56dc
@ -22,6 +22,9 @@ set -x # Display commands being run.
|
|||||||
|
|
||||||
cd github/cppdap
|
cd github/cppdap
|
||||||
|
|
||||||
|
# Silence "fatal: unsafe repository" errors
|
||||||
|
git config --global --add safe.directory '*'
|
||||||
|
|
||||||
git submodule update --init
|
git submodule update --init
|
||||||
|
|
||||||
if [ "$BUILD_SYSTEM" == "cmake" ]; then
|
if [ "$BUILD_SYSTEM" == "cmake" ]; then
|
||||||
|
@ -488,19 +488,18 @@ func (r *root) getType(def *definition) (builtType cppType, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(def.OneOf) != 0 {
|
if len(def.OneOf) != 0 {
|
||||||
args := []string{}
|
args := make([]string, len(def.OneOf))
|
||||||
deps := []cppType{}
|
deps := make([]cppType, len(def.OneOf))
|
||||||
for i := 0; i < len(def.OneOf); i++ {
|
for i, oneOf := range def.OneOf {
|
||||||
if def.OneOf[i] == nil {
|
if oneOf == nil {
|
||||||
return nil, fmt.Errorf("Item %d in oneOf is nil", i)
|
return nil, fmt.Errorf("Item %d in oneOf is nil", i)
|
||||||
}
|
}
|
||||||
|
elTy, err := r.getType(oneOf)
|
||||||
elTy, err := r.getType(def.OneOf[i])
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
deps = append(deps, elTy)
|
deps[i] = elTy
|
||||||
args = append(args, elTy.Name())
|
args[i] = elTy.Name()
|
||||||
}
|
}
|
||||||
return &cppBasicType{
|
return &cppBasicType{
|
||||||
name: "variant<" + strings.Join(args, ", ") + ">",
|
name: "variant<" + strings.Join(args, ", ") + ">",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user