You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue 1: providing a function like Foo(bar any) t2 will be of type interface and its indirect type is struct, so if t1 is not of type struct it will cause an error but bar can handle everything, which leads into false positive error
Issue 2: providing a function like Foo(bar **int) t2 will be of type pointer and its indirect type is also pointer, so t1 may not point to the correct type of t2, which leads into false positive no error
Issue 3: providing a function like Foo(bar struct{}) t2 will be of type struct but struct != struct, so t1 must match the syntax of t2 struct. just checking struct must be struct may lead into false positive no error
I first considered open a pull request, but solving the issues is not trivial, so I would prefer to just omit the verify check and let the implementation raise panics if devs define task values wrong.
The text was updated successfully, but these errors were encountered:
c14h3
changed the title
false positive errors on verify types of paramters
[BUG] - false positive errors on verify types of paramters
Nov 11, 2024
Issue 2: **int as a function type isn't allowed. Could you help with an example here?
Issue 3: agree, this is a current issue that if the struct isn't the same struct it will still pass. And then, fail silently, as in the job just won't run. I haven't pinpointed the issue here yet, but very interesting...
gocron/scheduler.go
Lines 577 to 616 in 31de1e8
Issue 1: providing a function like Foo(bar any) t2 will be of type interface and its indirect type is struct, so if t1 is not of type struct it will cause an error but bar can handle everything, which leads into false positive error
Issue 2: providing a function like Foo(bar **int) t2 will be of type pointer and its indirect type is also pointer, so t1 may not point to the correct type of t2, which leads into false positive no error
Issue 3: providing a function like Foo(bar struct{}) t2 will be of type struct but struct != struct, so t1 must match the syntax of t2 struct. just checking struct must be struct may lead into false positive no error
I first considered open a pull request, but solving the issues is not trivial, so I would prefer to just omit the verify check and let the implementation raise panics if devs define task values wrong.
The text was updated successfully, but these errors were encountered: