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
The parameter requirement is EntryID, why is 1 possible?
Here you're assigning the numeric literal directly to the argument and therefore the inferred (or implicitly converted?) type corresponds to the required one. This is possible because cron.EntryID is an alias typedef for int.
There is no error, why can't the id?
While here you first assign the literal to id, which makes the variable have type int and then when you call cron.New().Remove(id) the types do not match.
In fact, if you explicitly type the variable var id cron.EntryID = 1 the removal runs as expected.
code:
id := 1
cron.New().Remove(1)
cron.New().Remove(id)
question:
The text was updated successfully, but these errors were encountered: