Skip to content

Commit

Permalink
Fix interface compliance verifications (#933)
Browse files Browse the repository at this point in the history
There's some invalid interface compliance verification checks
in annotated.go. Fixing these.
  • Loading branch information
sywhang authored Aug 25, 2022
1 parent a3d266e commit 098c289
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions annotated.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ type paramTagsAnnotation struct {
tags []string
}

var _ paramTagsAnnotation = paramTagsAnnotation{}
var _ Annotation = paramTagsAnnotation{}

// Given func(T1, T2, T3, ..., TN), this generates a type roughly
// equivalent to,
Expand Down Expand Up @@ -165,7 +165,7 @@ type resultTagsAnnotation struct {
tags []string
}

var _ resultTagsAnnotation = resultTagsAnnotation{}
var _ Annotation = resultTagsAnnotation{}

// Given func(T1, T2, T3, ..., TN), this generates a type roughly
// equivalent to,
Expand Down Expand Up @@ -209,6 +209,8 @@ type lifecycleHookAnnotation struct {
Target interface{}
}

var _ Annotation = (*lifecycleHookAnnotation)(nil)

func (la *lifecycleHookAnnotation) String() string {
name := "UnknownHookAnnotation"
switch la.Type {
Expand Down Expand Up @@ -523,7 +525,7 @@ type asAnnotation struct {
targets []interface{}
}

var _ asAnnotation = asAnnotation{}
var _ Annotation = asAnnotation{}

// As is an Annotation that annotates the result of a function (i.e. a
// constructor) to be provided as another interface.
Expand Down

0 comments on commit 098c289

Please sign in to comment.