all: Add configurable defaults (fixes #4224, fixes #6086) (#7131)

This commit is contained in:
Simon Frei
2021-02-04 21:10:41 +01:00
committed by GitHub
parent 31119ed61a
commit ffc14a77c6
41 changed files with 1708 additions and 1046 deletions
+7
View File
@@ -292,6 +292,13 @@ func HandleCustomExtensions(file *descriptor.FileDescriptorProto) func(msg *desc
current += fmt.Sprintf(`default:"%s"`, defaultValue)
}
if nodefaultValue, ok := GetFieldBooleanExtension(field, ext.E_Nodefault); ok {
if len(current) > 0 {
current += " "
}
current += fmt.Sprintf(`nodefault:"%t"`, nodefaultValue)
}
if restartValue, ok := GetFieldBooleanExtension(field, ext.E_Restart); ok {
if len(current) > 0 {
current += " "