Skip to content

Commit

Permalink
chore: omit comparison to bool constant
Browse files Browse the repository at this point in the history
  • Loading branch information
testwill authored and Jefftree committed Nov 27, 2024
1 parent 8f45726 commit d9cde49
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 47 deletions.
30 changes: 15 additions & 15 deletions discovery/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -2283,15 +2283,15 @@ func (m *Document) ToRawInfo() *yaml.Node {
info.Content = append(info.Content, compiler.NewScalarNodeForString("ownerName"))
info.Content = append(info.Content, compiler.NewScalarNodeForString(m.OwnerName))
}
if m.VersionModule != false {
if m.VersionModule {
info.Content = append(info.Content, compiler.NewScalarNodeForString("version_module"))
info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.VersionModule))
}
if m.CanonicalName != "" {
info.Content = append(info.Content, compiler.NewScalarNodeForString("canonicalName"))
info.Content = append(info.Content, compiler.NewScalarNodeForString(m.CanonicalName))
}
if m.FullyEncodeReservedExpansion != false {
if m.FullyEncodeReservedExpansion {
info.Content = append(info.Content, compiler.NewScalarNodeForString("fullyEncodeReservedExpansion"))
info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.FullyEncodeReservedExpansion))
}
Expand Down Expand Up @@ -2339,7 +2339,7 @@ func (m *MediaUpload) ToRawInfo() *yaml.Node {
info.Content = append(info.Content, compiler.NewScalarNodeForString("protocols"))
info.Content = append(info.Content, m.Protocols.ToRawInfo())
}
if m.SupportsSubscription != false {
if m.SupportsSubscription {
info.Content = append(info.Content, compiler.NewScalarNodeForString("supportsSubscription"))
info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.SupportsSubscription))
}
Expand Down Expand Up @@ -2388,31 +2388,31 @@ func (m *Method) ToRawInfo() *yaml.Node {
info.Content = append(info.Content, compiler.NewScalarNodeForString("scopes"))
info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Scopes))
}
if m.SupportsMediaDownload != false {
if m.SupportsMediaDownload {
info.Content = append(info.Content, compiler.NewScalarNodeForString("supportsMediaDownload"))
info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.SupportsMediaDownload))
}
if m.SupportsMediaUpload != false {
if m.SupportsMediaUpload {
info.Content = append(info.Content, compiler.NewScalarNodeForString("supportsMediaUpload"))
info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.SupportsMediaUpload))
}
if m.UseMediaDownloadService != false {
if m.UseMediaDownloadService {
info.Content = append(info.Content, compiler.NewScalarNodeForString("useMediaDownloadService"))
info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.UseMediaDownloadService))
}
if m.MediaUpload != nil {
info.Content = append(info.Content, compiler.NewScalarNodeForString("mediaUpload"))
info.Content = append(info.Content, m.MediaUpload.ToRawInfo())
}
if m.SupportsSubscription != false {
if m.SupportsSubscription {
info.Content = append(info.Content, compiler.NewScalarNodeForString("supportsSubscription"))
info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.SupportsSubscription))
}
if m.FlatPath != "" {
info.Content = append(info.Content, compiler.NewScalarNodeForString("flatPath"))
info.Content = append(info.Content, compiler.NewScalarNodeForString(m.FlatPath))
}
if m.EtagRequired != false {
if m.EtagRequired {
info.Content = append(info.Content, compiler.NewScalarNodeForString("etagRequired"))
info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.EtagRequired))
}
Expand Down Expand Up @@ -2547,7 +2547,7 @@ func (m *Parameter) ToRawInfo() *yaml.Node {
info.Content = append(info.Content, compiler.NewScalarNodeForString("default"))
info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Default))
}
if m.Required != false {
if m.Required {
info.Content = append(info.Content, compiler.NewScalarNodeForString("required"))
info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Required))
}
Expand Down Expand Up @@ -2575,7 +2575,7 @@ func (m *Parameter) ToRawInfo() *yaml.Node {
info.Content = append(info.Content, compiler.NewScalarNodeForString("enumDescriptions"))
info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.EnumDescriptions))
}
if m.Repeated != false {
if m.Repeated {
info.Content = append(info.Content, compiler.NewScalarNodeForString("repeated"))
info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Repeated))
}
Expand Down Expand Up @@ -2702,7 +2702,7 @@ func (m *Resumable) ToRawInfo() *yaml.Node {
if m == nil {
return info
}
if m.Multipart != false {
if m.Multipart {
info.Content = append(info.Content, compiler.NewScalarNodeForString("multipart"))
info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Multipart))
}
Expand Down Expand Up @@ -2735,7 +2735,7 @@ func (m *Schema) ToRawInfo() *yaml.Node {
info.Content = append(info.Content, compiler.NewScalarNodeForString("default"))
info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Default))
}
if m.Required != false {
if m.Required {
info.Content = append(info.Content, compiler.NewScalarNodeForString("required"))
info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Required))
}
Expand Down Expand Up @@ -2763,7 +2763,7 @@ func (m *Schema) ToRawInfo() *yaml.Node {
info.Content = append(info.Content, compiler.NewScalarNodeForString("enumDescriptions"))
info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.EnumDescriptions))
}
if m.Repeated != false {
if m.Repeated {
info.Content = append(info.Content, compiler.NewScalarNodeForString("repeated"))
info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Repeated))
}
Expand Down Expand Up @@ -2791,7 +2791,7 @@ func (m *Schema) ToRawInfo() *yaml.Node {
info.Content = append(info.Content, compiler.NewScalarNodeForString("annotations"))
info.Content = append(info.Content, m.Annotations.ToRawInfo())
}
if m.ReadOnly != false {
if m.ReadOnly {
info.Content = append(info.Content, compiler.NewScalarNodeForString("readOnly"))
info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ReadOnly))
}
Expand Down Expand Up @@ -2847,7 +2847,7 @@ func (m *Simple) ToRawInfo() *yaml.Node {
if m == nil {
return info
}
if m.Multipart != false {
if m.Multipart {
info.Content = append(info.Content, compiler.NewScalarNodeForString("multipart"))
info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Multipart))
}
Expand Down
Loading

0 comments on commit d9cde49

Please sign in to comment.