...

Source file src/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor_gostring.gen.go

Documentation: github.com/gogo/protobuf/protoc-gen-gogo/descriptor

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: descriptor.proto
     3  
     4  package descriptor
     5  
     6  import (
     7  	fmt "fmt"
     8  	github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto"
     9  	proto "github.com/gogo/protobuf/proto"
    10  	math "math"
    11  	reflect "reflect"
    12  	sort "sort"
    13  	strconv "strconv"
    14  	strings "strings"
    15  )
    16  
    17  // Reference imports to suppress errors if they are not otherwise used.
    18  var _ = proto.Marshal
    19  var _ = fmt.Errorf
    20  var _ = math.Inf
    21  
    22  func (this *FileDescriptorSet) GoString() string {
    23  	if this == nil {
    24  		return "nil"
    25  	}
    26  	s := make([]string, 0, 5)
    27  	s = append(s, "&descriptor.FileDescriptorSet{")
    28  	if this.File != nil {
    29  		s = append(s, "File: "+fmt.Sprintf("%#v", this.File)+",\n")
    30  	}
    31  	if this.XXX_unrecognized != nil {
    32  		s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
    33  	}
    34  	s = append(s, "}")
    35  	return strings.Join(s, "")
    36  }
    37  func (this *FileDescriptorProto) GoString() string {
    38  	if this == nil {
    39  		return "nil"
    40  	}
    41  	s := make([]string, 0, 16)
    42  	s = append(s, "&descriptor.FileDescriptorProto{")
    43  	if this.Name != nil {
    44  		s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n")
    45  	}
    46  	if this.Package != nil {
    47  		s = append(s, "Package: "+valueToGoStringDescriptor(this.Package, "string")+",\n")
    48  	}
    49  	if this.Dependency != nil {
    50  		s = append(s, "Dependency: "+fmt.Sprintf("%#v", this.Dependency)+",\n")
    51  	}
    52  	if this.PublicDependency != nil {
    53  		s = append(s, "PublicDependency: "+fmt.Sprintf("%#v", this.PublicDependency)+",\n")
    54  	}
    55  	if this.WeakDependency != nil {
    56  		s = append(s, "WeakDependency: "+fmt.Sprintf("%#v", this.WeakDependency)+",\n")
    57  	}
    58  	if this.MessageType != nil {
    59  		s = append(s, "MessageType: "+fmt.Sprintf("%#v", this.MessageType)+",\n")
    60  	}
    61  	if this.EnumType != nil {
    62  		s = append(s, "EnumType: "+fmt.Sprintf("%#v", this.EnumType)+",\n")
    63  	}
    64  	if this.Service != nil {
    65  		s = append(s, "Service: "+fmt.Sprintf("%#v", this.Service)+",\n")
    66  	}
    67  	if this.Extension != nil {
    68  		s = append(s, "Extension: "+fmt.Sprintf("%#v", this.Extension)+",\n")
    69  	}
    70  	if this.Options != nil {
    71  		s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n")
    72  	}
    73  	if this.SourceCodeInfo != nil {
    74  		s = append(s, "SourceCodeInfo: "+fmt.Sprintf("%#v", this.SourceCodeInfo)+",\n")
    75  	}
    76  	if this.Syntax != nil {
    77  		s = append(s, "Syntax: "+valueToGoStringDescriptor(this.Syntax, "string")+",\n")
    78  	}
    79  	if this.XXX_unrecognized != nil {
    80  		s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
    81  	}
    82  	s = append(s, "}")
    83  	return strings.Join(s, "")
    84  }
    85  func (this *DescriptorProto) GoString() string {
    86  	if this == nil {
    87  		return "nil"
    88  	}
    89  	s := make([]string, 0, 14)
    90  	s = append(s, "&descriptor.DescriptorProto{")
    91  	if this.Name != nil {
    92  		s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n")
    93  	}
    94  	if this.Field != nil {
    95  		s = append(s, "Field: "+fmt.Sprintf("%#v", this.Field)+",\n")
    96  	}
    97  	if this.Extension != nil {
    98  		s = append(s, "Extension: "+fmt.Sprintf("%#v", this.Extension)+",\n")
    99  	}
   100  	if this.NestedType != nil {
   101  		s = append(s, "NestedType: "+fmt.Sprintf("%#v", this.NestedType)+",\n")
   102  	}
   103  	if this.EnumType != nil {
   104  		s = append(s, "EnumType: "+fmt.Sprintf("%#v", this.EnumType)+",\n")
   105  	}
   106  	if this.ExtensionRange != nil {
   107  		s = append(s, "ExtensionRange: "+fmt.Sprintf("%#v", this.ExtensionRange)+",\n")
   108  	}
   109  	if this.OneofDecl != nil {
   110  		s = append(s, "OneofDecl: "+fmt.Sprintf("%#v", this.OneofDecl)+",\n")
   111  	}
   112  	if this.Options != nil {
   113  		s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n")
   114  	}
   115  	if this.ReservedRange != nil {
   116  		s = append(s, "ReservedRange: "+fmt.Sprintf("%#v", this.ReservedRange)+",\n")
   117  	}
   118  	if this.ReservedName != nil {
   119  		s = append(s, "ReservedName: "+fmt.Sprintf("%#v", this.ReservedName)+",\n")
   120  	}
   121  	if this.XXX_unrecognized != nil {
   122  		s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
   123  	}
   124  	s = append(s, "}")
   125  	return strings.Join(s, "")
   126  }
   127  func (this *DescriptorProto_ExtensionRange) GoString() string {
   128  	if this == nil {
   129  		return "nil"
   130  	}
   131  	s := make([]string, 0, 7)
   132  	s = append(s, "&descriptor.DescriptorProto_ExtensionRange{")
   133  	if this.Start != nil {
   134  		s = append(s, "Start: "+valueToGoStringDescriptor(this.Start, "int32")+",\n")
   135  	}
   136  	if this.End != nil {
   137  		s = append(s, "End: "+valueToGoStringDescriptor(this.End, "int32")+",\n")
   138  	}
   139  	if this.Options != nil {
   140  		s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n")
   141  	}
   142  	if this.XXX_unrecognized != nil {
   143  		s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
   144  	}
   145  	s = append(s, "}")
   146  	return strings.Join(s, "")
   147  }
   148  func (this *DescriptorProto_ReservedRange) GoString() string {
   149  	if this == nil {
   150  		return "nil"
   151  	}
   152  	s := make([]string, 0, 6)
   153  	s = append(s, "&descriptor.DescriptorProto_ReservedRange{")
   154  	if this.Start != nil {
   155  		s = append(s, "Start: "+valueToGoStringDescriptor(this.Start, "int32")+",\n")
   156  	}
   157  	if this.End != nil {
   158  		s = append(s, "End: "+valueToGoStringDescriptor(this.End, "int32")+",\n")
   159  	}
   160  	if this.XXX_unrecognized != nil {
   161  		s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
   162  	}
   163  	s = append(s, "}")
   164  	return strings.Join(s, "")
   165  }
   166  func (this *ExtensionRangeOptions) GoString() string {
   167  	if this == nil {
   168  		return "nil"
   169  	}
   170  	s := make([]string, 0, 5)
   171  	s = append(s, "&descriptor.ExtensionRangeOptions{")
   172  	if this.UninterpretedOption != nil {
   173  		s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n")
   174  	}
   175  	s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n")
   176  	if this.XXX_unrecognized != nil {
   177  		s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
   178  	}
   179  	s = append(s, "}")
   180  	return strings.Join(s, "")
   181  }
   182  func (this *FieldDescriptorProto) GoString() string {
   183  	if this == nil {
   184  		return "nil"
   185  	}
   186  	s := make([]string, 0, 14)
   187  	s = append(s, "&descriptor.FieldDescriptorProto{")
   188  	if this.Name != nil {
   189  		s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n")
   190  	}
   191  	if this.Number != nil {
   192  		s = append(s, "Number: "+valueToGoStringDescriptor(this.Number, "int32")+",\n")
   193  	}
   194  	if this.Label != nil {
   195  		s = append(s, "Label: "+valueToGoStringDescriptor(this.Label, "FieldDescriptorProto_Label")+",\n")
   196  	}
   197  	if this.Type != nil {
   198  		s = append(s, "Type: "+valueToGoStringDescriptor(this.Type, "FieldDescriptorProto_Type")+",\n")
   199  	}
   200  	if this.TypeName != nil {
   201  		s = append(s, "TypeName: "+valueToGoStringDescriptor(this.TypeName, "string")+",\n")
   202  	}
   203  	if this.Extendee != nil {
   204  		s = append(s, "Extendee: "+valueToGoStringDescriptor(this.Extendee, "string")+",\n")
   205  	}
   206  	if this.DefaultValue != nil {
   207  		s = append(s, "DefaultValue: "+valueToGoStringDescriptor(this.DefaultValue, "string")+",\n")
   208  	}
   209  	if this.OneofIndex != nil {
   210  		s = append(s, "OneofIndex: "+valueToGoStringDescriptor(this.OneofIndex, "int32")+",\n")
   211  	}
   212  	if this.JsonName != nil {
   213  		s = append(s, "JsonName: "+valueToGoStringDescriptor(this.JsonName, "string")+",\n")
   214  	}
   215  	if this.Options != nil {
   216  		s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n")
   217  	}
   218  	if this.XXX_unrecognized != nil {
   219  		s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
   220  	}
   221  	s = append(s, "}")
   222  	return strings.Join(s, "")
   223  }
   224  func (this *OneofDescriptorProto) GoString() string {
   225  	if this == nil {
   226  		return "nil"
   227  	}
   228  	s := make([]string, 0, 6)
   229  	s = append(s, "&descriptor.OneofDescriptorProto{")
   230  	if this.Name != nil {
   231  		s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n")
   232  	}
   233  	if this.Options != nil {
   234  		s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n")
   235  	}
   236  	if this.XXX_unrecognized != nil {
   237  		s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
   238  	}
   239  	s = append(s, "}")
   240  	return strings.Join(s, "")
   241  }
   242  func (this *EnumDescriptorProto) GoString() string {
   243  	if this == nil {
   244  		return "nil"
   245  	}
   246  	s := make([]string, 0, 9)
   247  	s = append(s, "&descriptor.EnumDescriptorProto{")
   248  	if this.Name != nil {
   249  		s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n")
   250  	}
   251  	if this.Value != nil {
   252  		s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n")
   253  	}
   254  	if this.Options != nil {
   255  		s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n")
   256  	}
   257  	if this.ReservedRange != nil {
   258  		s = append(s, "ReservedRange: "+fmt.Sprintf("%#v", this.ReservedRange)+",\n")
   259  	}
   260  	if this.ReservedName != nil {
   261  		s = append(s, "ReservedName: "+fmt.Sprintf("%#v", this.ReservedName)+",\n")
   262  	}
   263  	if this.XXX_unrecognized != nil {
   264  		s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
   265  	}
   266  	s = append(s, "}")
   267  	return strings.Join(s, "")
   268  }
   269  func (this *EnumDescriptorProto_EnumReservedRange) GoString() string {
   270  	if this == nil {
   271  		return "nil"
   272  	}
   273  	s := make([]string, 0, 6)
   274  	s = append(s, "&descriptor.EnumDescriptorProto_EnumReservedRange{")
   275  	if this.Start != nil {
   276  		s = append(s, "Start: "+valueToGoStringDescriptor(this.Start, "int32")+",\n")
   277  	}
   278  	if this.End != nil {
   279  		s = append(s, "End: "+valueToGoStringDescriptor(this.End, "int32")+",\n")
   280  	}
   281  	if this.XXX_unrecognized != nil {
   282  		s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
   283  	}
   284  	s = append(s, "}")
   285  	return strings.Join(s, "")
   286  }
   287  func (this *EnumValueDescriptorProto) GoString() string {
   288  	if this == nil {
   289  		return "nil"
   290  	}
   291  	s := make([]string, 0, 7)
   292  	s = append(s, "&descriptor.EnumValueDescriptorProto{")
   293  	if this.Name != nil {
   294  		s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n")
   295  	}
   296  	if this.Number != nil {
   297  		s = append(s, "Number: "+valueToGoStringDescriptor(this.Number, "int32")+",\n")
   298  	}
   299  	if this.Options != nil {
   300  		s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n")
   301  	}
   302  	if this.XXX_unrecognized != nil {
   303  		s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
   304  	}
   305  	s = append(s, "}")
   306  	return strings.Join(s, "")
   307  }
   308  func (this *ServiceDescriptorProto) GoString() string {
   309  	if this == nil {
   310  		return "nil"
   311  	}
   312  	s := make([]string, 0, 7)
   313  	s = append(s, "&descriptor.ServiceDescriptorProto{")
   314  	if this.Name != nil {
   315  		s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n")
   316  	}
   317  	if this.Method != nil {
   318  		s = append(s, "Method: "+fmt.Sprintf("%#v", this.Method)+",\n")
   319  	}
   320  	if this.Options != nil {
   321  		s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n")
   322  	}
   323  	if this.XXX_unrecognized != nil {
   324  		s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
   325  	}
   326  	s = append(s, "}")
   327  	return strings.Join(s, "")
   328  }
   329  func (this *MethodDescriptorProto) GoString() string {
   330  	if this == nil {
   331  		return "nil"
   332  	}
   333  	s := make([]string, 0, 10)
   334  	s = append(s, "&descriptor.MethodDescriptorProto{")
   335  	if this.Name != nil {
   336  		s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n")
   337  	}
   338  	if this.InputType != nil {
   339  		s = append(s, "InputType: "+valueToGoStringDescriptor(this.InputType, "string")+",\n")
   340  	}
   341  	if this.OutputType != nil {
   342  		s = append(s, "OutputType: "+valueToGoStringDescriptor(this.OutputType, "string")+",\n")
   343  	}
   344  	if this.Options != nil {
   345  		s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n")
   346  	}
   347  	if this.ClientStreaming != nil {
   348  		s = append(s, "ClientStreaming: "+valueToGoStringDescriptor(this.ClientStreaming, "bool")+",\n")
   349  	}
   350  	if this.ServerStreaming != nil {
   351  		s = append(s, "ServerStreaming: "+valueToGoStringDescriptor(this.ServerStreaming, "bool")+",\n")
   352  	}
   353  	if this.XXX_unrecognized != nil {
   354  		s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
   355  	}
   356  	s = append(s, "}")
   357  	return strings.Join(s, "")
   358  }
   359  func (this *FileOptions) GoString() string {
   360  	if this == nil {
   361  		return "nil"
   362  	}
   363  	s := make([]string, 0, 25)
   364  	s = append(s, "&descriptor.FileOptions{")
   365  	if this.JavaPackage != nil {
   366  		s = append(s, "JavaPackage: "+valueToGoStringDescriptor(this.JavaPackage, "string")+",\n")
   367  	}
   368  	if this.JavaOuterClassname != nil {
   369  		s = append(s, "JavaOuterClassname: "+valueToGoStringDescriptor(this.JavaOuterClassname, "string")+",\n")
   370  	}
   371  	if this.JavaMultipleFiles != nil {
   372  		s = append(s, "JavaMultipleFiles: "+valueToGoStringDescriptor(this.JavaMultipleFiles, "bool")+",\n")
   373  	}
   374  	if this.JavaGenerateEqualsAndHash != nil {
   375  		s = append(s, "JavaGenerateEqualsAndHash: "+valueToGoStringDescriptor(this.JavaGenerateEqualsAndHash, "bool")+",\n")
   376  	}
   377  	if this.JavaStringCheckUtf8 != nil {
   378  		s = append(s, "JavaStringCheckUtf8: "+valueToGoStringDescriptor(this.JavaStringCheckUtf8, "bool")+",\n")
   379  	}
   380  	if this.OptimizeFor != nil {
   381  		s = append(s, "OptimizeFor: "+valueToGoStringDescriptor(this.OptimizeFor, "FileOptions_OptimizeMode")+",\n")
   382  	}
   383  	if this.GoPackage != nil {
   384  		s = append(s, "GoPackage: "+valueToGoStringDescriptor(this.GoPackage, "string")+",\n")
   385  	}
   386  	if this.CcGenericServices != nil {
   387  		s = append(s, "CcGenericServices: "+valueToGoStringDescriptor(this.CcGenericServices, "bool")+",\n")
   388  	}
   389  	if this.JavaGenericServices != nil {
   390  		s = append(s, "JavaGenericServices: "+valueToGoStringDescriptor(this.JavaGenericServices, "bool")+",\n")
   391  	}
   392  	if this.PyGenericServices != nil {
   393  		s = append(s, "PyGenericServices: "+valueToGoStringDescriptor(this.PyGenericServices, "bool")+",\n")
   394  	}
   395  	if this.PhpGenericServices != nil {
   396  		s = append(s, "PhpGenericServices: "+valueToGoStringDescriptor(this.PhpGenericServices, "bool")+",\n")
   397  	}
   398  	if this.Deprecated != nil {
   399  		s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n")
   400  	}
   401  	if this.CcEnableArenas != nil {
   402  		s = append(s, "CcEnableArenas: "+valueToGoStringDescriptor(this.CcEnableArenas, "bool")+",\n")
   403  	}
   404  	if this.ObjcClassPrefix != nil {
   405  		s = append(s, "ObjcClassPrefix: "+valueToGoStringDescriptor(this.ObjcClassPrefix, "string")+",\n")
   406  	}
   407  	if this.CsharpNamespace != nil {
   408  		s = append(s, "CsharpNamespace: "+valueToGoStringDescriptor(this.CsharpNamespace, "string")+",\n")
   409  	}
   410  	if this.SwiftPrefix != nil {
   411  		s = append(s, "SwiftPrefix: "+valueToGoStringDescriptor(this.SwiftPrefix, "string")+",\n")
   412  	}
   413  	if this.PhpClassPrefix != nil {
   414  		s = append(s, "PhpClassPrefix: "+valueToGoStringDescriptor(this.PhpClassPrefix, "string")+",\n")
   415  	}
   416  	if this.PhpNamespace != nil {
   417  		s = append(s, "PhpNamespace: "+valueToGoStringDescriptor(this.PhpNamespace, "string")+",\n")
   418  	}
   419  	if this.PhpMetadataNamespace != nil {
   420  		s = append(s, "PhpMetadataNamespace: "+valueToGoStringDescriptor(this.PhpMetadataNamespace, "string")+",\n")
   421  	}
   422  	if this.RubyPackage != nil {
   423  		s = append(s, "RubyPackage: "+valueToGoStringDescriptor(this.RubyPackage, "string")+",\n")
   424  	}
   425  	if this.UninterpretedOption != nil {
   426  		s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n")
   427  	}
   428  	s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n")
   429  	if this.XXX_unrecognized != nil {
   430  		s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
   431  	}
   432  	s = append(s, "}")
   433  	return strings.Join(s, "")
   434  }
   435  func (this *MessageOptions) GoString() string {
   436  	if this == nil {
   437  		return "nil"
   438  	}
   439  	s := make([]string, 0, 9)
   440  	s = append(s, "&descriptor.MessageOptions{")
   441  	if this.MessageSetWireFormat != nil {
   442  		s = append(s, "MessageSetWireFormat: "+valueToGoStringDescriptor(this.MessageSetWireFormat, "bool")+",\n")
   443  	}
   444  	if this.NoStandardDescriptorAccessor != nil {
   445  		s = append(s, "NoStandardDescriptorAccessor: "+valueToGoStringDescriptor(this.NoStandardDescriptorAccessor, "bool")+",\n")
   446  	}
   447  	if this.Deprecated != nil {
   448  		s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n")
   449  	}
   450  	if this.MapEntry != nil {
   451  		s = append(s, "MapEntry: "+valueToGoStringDescriptor(this.MapEntry, "bool")+",\n")
   452  	}
   453  	if this.UninterpretedOption != nil {
   454  		s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n")
   455  	}
   456  	s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n")
   457  	if this.XXX_unrecognized != nil {
   458  		s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
   459  	}
   460  	s = append(s, "}")
   461  	return strings.Join(s, "")
   462  }
   463  func (this *FieldOptions) GoString() string {
   464  	if this == nil {
   465  		return "nil"
   466  	}
   467  	s := make([]string, 0, 11)
   468  	s = append(s, "&descriptor.FieldOptions{")
   469  	if this.Ctype != nil {
   470  		s = append(s, "Ctype: "+valueToGoStringDescriptor(this.Ctype, "FieldOptions_CType")+",\n")
   471  	}
   472  	if this.Packed != nil {
   473  		s = append(s, "Packed: "+valueToGoStringDescriptor(this.Packed, "bool")+",\n")
   474  	}
   475  	if this.Jstype != nil {
   476  		s = append(s, "Jstype: "+valueToGoStringDescriptor(this.Jstype, "FieldOptions_JSType")+",\n")
   477  	}
   478  	if this.Lazy != nil {
   479  		s = append(s, "Lazy: "+valueToGoStringDescriptor(this.Lazy, "bool")+",\n")
   480  	}
   481  	if this.Deprecated != nil {
   482  		s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n")
   483  	}
   484  	if this.Weak != nil {
   485  		s = append(s, "Weak: "+valueToGoStringDescriptor(this.Weak, "bool")+",\n")
   486  	}
   487  	if this.UninterpretedOption != nil {
   488  		s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n")
   489  	}
   490  	s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n")
   491  	if this.XXX_unrecognized != nil {
   492  		s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
   493  	}
   494  	s = append(s, "}")
   495  	return strings.Join(s, "")
   496  }
   497  func (this *OneofOptions) GoString() string {
   498  	if this == nil {
   499  		return "nil"
   500  	}
   501  	s := make([]string, 0, 5)
   502  	s = append(s, "&descriptor.OneofOptions{")
   503  	if this.UninterpretedOption != nil {
   504  		s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n")
   505  	}
   506  	s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n")
   507  	if this.XXX_unrecognized != nil {
   508  		s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
   509  	}
   510  	s = append(s, "}")
   511  	return strings.Join(s, "")
   512  }
   513  func (this *EnumOptions) GoString() string {
   514  	if this == nil {
   515  		return "nil"
   516  	}
   517  	s := make([]string, 0, 7)
   518  	s = append(s, "&descriptor.EnumOptions{")
   519  	if this.AllowAlias != nil {
   520  		s = append(s, "AllowAlias: "+valueToGoStringDescriptor(this.AllowAlias, "bool")+",\n")
   521  	}
   522  	if this.Deprecated != nil {
   523  		s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n")
   524  	}
   525  	if this.UninterpretedOption != nil {
   526  		s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n")
   527  	}
   528  	s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n")
   529  	if this.XXX_unrecognized != nil {
   530  		s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
   531  	}
   532  	s = append(s, "}")
   533  	return strings.Join(s, "")
   534  }
   535  func (this *EnumValueOptions) GoString() string {
   536  	if this == nil {
   537  		return "nil"
   538  	}
   539  	s := make([]string, 0, 6)
   540  	s = append(s, "&descriptor.EnumValueOptions{")
   541  	if this.Deprecated != nil {
   542  		s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n")
   543  	}
   544  	if this.UninterpretedOption != nil {
   545  		s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n")
   546  	}
   547  	s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n")
   548  	if this.XXX_unrecognized != nil {
   549  		s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
   550  	}
   551  	s = append(s, "}")
   552  	return strings.Join(s, "")
   553  }
   554  func (this *ServiceOptions) GoString() string {
   555  	if this == nil {
   556  		return "nil"
   557  	}
   558  	s := make([]string, 0, 6)
   559  	s = append(s, "&descriptor.ServiceOptions{")
   560  	if this.Deprecated != nil {
   561  		s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n")
   562  	}
   563  	if this.UninterpretedOption != nil {
   564  		s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n")
   565  	}
   566  	s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n")
   567  	if this.XXX_unrecognized != nil {
   568  		s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
   569  	}
   570  	s = append(s, "}")
   571  	return strings.Join(s, "")
   572  }
   573  func (this *MethodOptions) GoString() string {
   574  	if this == nil {
   575  		return "nil"
   576  	}
   577  	s := make([]string, 0, 7)
   578  	s = append(s, "&descriptor.MethodOptions{")
   579  	if this.Deprecated != nil {
   580  		s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n")
   581  	}
   582  	if this.IdempotencyLevel != nil {
   583  		s = append(s, "IdempotencyLevel: "+valueToGoStringDescriptor(this.IdempotencyLevel, "MethodOptions_IdempotencyLevel")+",\n")
   584  	}
   585  	if this.UninterpretedOption != nil {
   586  		s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n")
   587  	}
   588  	s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n")
   589  	if this.XXX_unrecognized != nil {
   590  		s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
   591  	}
   592  	s = append(s, "}")
   593  	return strings.Join(s, "")
   594  }
   595  func (this *UninterpretedOption) GoString() string {
   596  	if this == nil {
   597  		return "nil"
   598  	}
   599  	s := make([]string, 0, 11)
   600  	s = append(s, "&descriptor.UninterpretedOption{")
   601  	if this.Name != nil {
   602  		s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n")
   603  	}
   604  	if this.IdentifierValue != nil {
   605  		s = append(s, "IdentifierValue: "+valueToGoStringDescriptor(this.IdentifierValue, "string")+",\n")
   606  	}
   607  	if this.PositiveIntValue != nil {
   608  		s = append(s, "PositiveIntValue: "+valueToGoStringDescriptor(this.PositiveIntValue, "uint64")+",\n")
   609  	}
   610  	if this.NegativeIntValue != nil {
   611  		s = append(s, "NegativeIntValue: "+valueToGoStringDescriptor(this.NegativeIntValue, "int64")+",\n")
   612  	}
   613  	if this.DoubleValue != nil {
   614  		s = append(s, "DoubleValue: "+valueToGoStringDescriptor(this.DoubleValue, "float64")+",\n")
   615  	}
   616  	if this.StringValue != nil {
   617  		s = append(s, "StringValue: "+valueToGoStringDescriptor(this.StringValue, "byte")+",\n")
   618  	}
   619  	if this.AggregateValue != nil {
   620  		s = append(s, "AggregateValue: "+valueToGoStringDescriptor(this.AggregateValue, "string")+",\n")
   621  	}
   622  	if this.XXX_unrecognized != nil {
   623  		s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
   624  	}
   625  	s = append(s, "}")
   626  	return strings.Join(s, "")
   627  }
   628  func (this *UninterpretedOption_NamePart) GoString() string {
   629  	if this == nil {
   630  		return "nil"
   631  	}
   632  	s := make([]string, 0, 6)
   633  	s = append(s, "&descriptor.UninterpretedOption_NamePart{")
   634  	if this.NamePart != nil {
   635  		s = append(s, "NamePart: "+valueToGoStringDescriptor(this.NamePart, "string")+",\n")
   636  	}
   637  	if this.IsExtension != nil {
   638  		s = append(s, "IsExtension: "+valueToGoStringDescriptor(this.IsExtension, "bool")+",\n")
   639  	}
   640  	if this.XXX_unrecognized != nil {
   641  		s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
   642  	}
   643  	s = append(s, "}")
   644  	return strings.Join(s, "")
   645  }
   646  func (this *SourceCodeInfo) GoString() string {
   647  	if this == nil {
   648  		return "nil"
   649  	}
   650  	s := make([]string, 0, 5)
   651  	s = append(s, "&descriptor.SourceCodeInfo{")
   652  	if this.Location != nil {
   653  		s = append(s, "Location: "+fmt.Sprintf("%#v", this.Location)+",\n")
   654  	}
   655  	if this.XXX_unrecognized != nil {
   656  		s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
   657  	}
   658  	s = append(s, "}")
   659  	return strings.Join(s, "")
   660  }
   661  func (this *SourceCodeInfo_Location) GoString() string {
   662  	if this == nil {
   663  		return "nil"
   664  	}
   665  	s := make([]string, 0, 9)
   666  	s = append(s, "&descriptor.SourceCodeInfo_Location{")
   667  	if this.Path != nil {
   668  		s = append(s, "Path: "+fmt.Sprintf("%#v", this.Path)+",\n")
   669  	}
   670  	if this.Span != nil {
   671  		s = append(s, "Span: "+fmt.Sprintf("%#v", this.Span)+",\n")
   672  	}
   673  	if this.LeadingComments != nil {
   674  		s = append(s, "LeadingComments: "+valueToGoStringDescriptor(this.LeadingComments, "string")+",\n")
   675  	}
   676  	if this.TrailingComments != nil {
   677  		s = append(s, "TrailingComments: "+valueToGoStringDescriptor(this.TrailingComments, "string")+",\n")
   678  	}
   679  	if this.LeadingDetachedComments != nil {
   680  		s = append(s, "LeadingDetachedComments: "+fmt.Sprintf("%#v", this.LeadingDetachedComments)+",\n")
   681  	}
   682  	if this.XXX_unrecognized != nil {
   683  		s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
   684  	}
   685  	s = append(s, "}")
   686  	return strings.Join(s, "")
   687  }
   688  func (this *GeneratedCodeInfo) GoString() string {
   689  	if this == nil {
   690  		return "nil"
   691  	}
   692  	s := make([]string, 0, 5)
   693  	s = append(s, "&descriptor.GeneratedCodeInfo{")
   694  	if this.Annotation != nil {
   695  		s = append(s, "Annotation: "+fmt.Sprintf("%#v", this.Annotation)+",\n")
   696  	}
   697  	if this.XXX_unrecognized != nil {
   698  		s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
   699  	}
   700  	s = append(s, "}")
   701  	return strings.Join(s, "")
   702  }
   703  func (this *GeneratedCodeInfo_Annotation) GoString() string {
   704  	if this == nil {
   705  		return "nil"
   706  	}
   707  	s := make([]string, 0, 8)
   708  	s = append(s, "&descriptor.GeneratedCodeInfo_Annotation{")
   709  	if this.Path != nil {
   710  		s = append(s, "Path: "+fmt.Sprintf("%#v", this.Path)+",\n")
   711  	}
   712  	if this.SourceFile != nil {
   713  		s = append(s, "SourceFile: "+valueToGoStringDescriptor(this.SourceFile, "string")+",\n")
   714  	}
   715  	if this.Begin != nil {
   716  		s = append(s, "Begin: "+valueToGoStringDescriptor(this.Begin, "int32")+",\n")
   717  	}
   718  	if this.End != nil {
   719  		s = append(s, "End: "+valueToGoStringDescriptor(this.End, "int32")+",\n")
   720  	}
   721  	if this.XXX_unrecognized != nil {
   722  		s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
   723  	}
   724  	s = append(s, "}")
   725  	return strings.Join(s, "")
   726  }
   727  func valueToGoStringDescriptor(v interface{}, typ string) string {
   728  	rv := reflect.ValueOf(v)
   729  	if rv.IsNil() {
   730  		return "nil"
   731  	}
   732  	pv := reflect.Indirect(rv).Interface()
   733  	return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
   734  }
   735  func extensionToGoStringDescriptor(m github_com_gogo_protobuf_proto.Message) string {
   736  	e := github_com_gogo_protobuf_proto.GetUnsafeExtensionsMap(m)
   737  	if e == nil {
   738  		return "nil"
   739  	}
   740  	s := "proto.NewUnsafeXXX_InternalExtensions(map[int32]proto.Extension{"
   741  	keys := make([]int, 0, len(e))
   742  	for k := range e {
   743  		keys = append(keys, int(k))
   744  	}
   745  	sort.Ints(keys)
   746  	ss := []string{}
   747  	for _, k := range keys {
   748  		ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString())
   749  	}
   750  	s += strings.Join(ss, ",") + "})"
   751  	return s
   752  }
   753  

View as plain text