Skip to content

Commit

Permalink
Fix recvcheck linter issue
Browse files Browse the repository at this point in the history
  • Loading branch information
super-harsh committed Dec 17, 2024
1 parent 32fe311 commit da1c34a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions v2/tools/generator/internal/astmodel/type_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (ts *TypeSet) Remove(t Type) bool {
}

// Contains checks if the set already contains the type
func (ts TypeSet) Contains(t Type, overrides EqualityOverrides) bool {
func (ts *TypeSet) Contains(t Type, overrides EqualityOverrides) bool {
// this is slow, but what can you do?
for _, other := range ts.types {
if t.Equals(other, overrides) {
Expand All @@ -92,7 +92,7 @@ func (ts TypeSet) Contains(t Type, overrides EqualityOverrides) bool {
}

// Equals returns true if both sets contain the same types
func (ts TypeSet) Equals(other TypeSet, overrides ...EqualityOverrides) bool {
func (ts *TypeSet) Equals(other TypeSet, overrides ...EqualityOverrides) bool {
if len(ts.types) != len(other.types) {
return false
}
Expand All @@ -116,12 +116,12 @@ func (ts TypeSet) Equals(other TypeSet, overrides ...EqualityOverrides) bool {
}

// Len returns the number of items in the set
func (ts TypeSet) Len() int {
func (ts *TypeSet) Len() int {
return len(ts.types)
}

// Single returns the only item in the set, and true, if it contains exactly one; otherwise it returns nil and false.
func (ts TypeSet) Single() (Type, bool) {
func (ts *TypeSet) Single() (Type, bool) {
if len(ts.types) != 1 {
return nil, false
}
Expand All @@ -130,12 +130,12 @@ func (ts TypeSet) Single() (Type, bool) {
}

// Copy returns a copy of this set that can then be modified.
func (ts TypeSet) Copy() TypeSet {
func (ts *TypeSet) Copy() TypeSet {
return MakeTypeSet(ts.types...)
}

// AsSlice returns the content of this set as a slice
func (ts TypeSet) AsSlice() []Type {
func (ts *TypeSet) AsSlice() []Type {
result := make([]Type, 0, len(ts.types))
result = append(result, ts.types...)
return result
Expand Down
4 changes: 2 additions & 2 deletions v2/tools/generator/internal/astmodel/validated_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,14 @@ func equalRegexpSlices(left []*regexp.Regexp, right []*regexp.Regexp) bool {
}

// Unwrap returns the type contained within the validated type
func (v ValidatedType) Unwrap() Type {
func (v *ValidatedType) Unwrap() Type {
return v.element
}

// WriteDebugDescription adds a description of the current type to the passed builder
// builder receives the full description, including nested types
// definitions is a dictionary for resolving named types
func (v ValidatedType) WriteDebugDescription(builder *strings.Builder, currentPackage InternalPackageReference) {
func (v *ValidatedType) WriteDebugDescription(builder *strings.Builder, currentPackage InternalPackageReference) {
builder.WriteString("Validated[")
if v.element != nil {
v.element.WriteDebugDescription(builder, currentPackage)
Expand Down

0 comments on commit da1c34a

Please sign in to comment.