Skip to content

Commit

Permalink
Fix GitHub check annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
HaraldNordgren committed Jul 28, 2024
1 parent 0bf2e8a commit 534d131
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions internal/template/template_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func (m MethodData) ReturnArgNameList() string {
return strings.Join(params, ", ")
}

// TypeParamData is a ParamData with an additional constraint field.
type TypeParamData struct {
ParamData
Constraint types.Type
Expand Down
1 change: 1 addition & 0 deletions pkg/moq/testpackages/anonimport/iface.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
)

// Example is used to test issues with packages, which import another package with the same name
type Example interface {
Ctx(ctx context.Context)
}
2 changes: 1 addition & 1 deletion pkg/moq/testpackages/anonimport/second_file.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package anonimport

import (
_ "context"
_ "context" // import for side effects
)
1 change: 1 addition & 0 deletions pkg/moq/testpackages/blankid/swallower.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package blankid

// Swallower is a test interface.
type Swallower interface {
Swallow(_ string)
}
2 changes: 2 additions & 0 deletions pkg/moq/testpackages/genericreturn/genericreturn.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ package genericreturn

import "github.com/matryer/moq/pkg/moq/testpackages/genericreturn/otherpackage"

// GenericFoo is a generic type.

Check failure on line 5 in pkg/moq/testpackages/genericreturn/genericreturn.go

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 1.18.x)

comment on exported type GenericBar should be of the form "GenericBar ..." (with optional leading article)

Check failure on line 5 in pkg/moq/testpackages/genericreturn/genericreturn.go

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 1.19.x)

comment on exported type GenericBar should be of the form "GenericBar ..." (with optional leading article)
type GenericBar[T any] struct {
Bar T
}

// IFooBar is a test interface.
type IFooBar interface {
Foobar() GenericBar[otherpackage.Foo]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package otherpackage

// Foo is a test struct.
type Foo struct {
A int
B string
Expand Down
3 changes: 3 additions & 0 deletions pkg/moq/testpackages/generics/generics.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@ import (
"fmt"
)

// GenericStore1 is a test interface.
type GenericStore1[T Key1, S any] interface {
Get(ctx context.Context, id T) (S, error)
Create(ctx context.Context, id T, value S) error
}

// GenericStore2 is a test interface.
type GenericStore2[T Key2, S any] interface {
Get(ctx context.Context, id T) (S, error)
Create(ctx context.Context, id T, value S) error
}

// AliasStore is a test interface.
type AliasStore GenericStore1[KeyImpl, bool]

type Key1 interface {

Check failure on line 23 in pkg/moq/testpackages/generics/generics.go

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 1.18.x)

exported type Key1 should have comment or be unexported

Check failure on line 23 in pkg/moq/testpackages/generics/generics.go

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 1.19.x)

exported type Key1 should have comment or be unexported
Expand Down

0 comments on commit 534d131

Please sign in to comment.