Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A trivial mistake in the code comment #399

Open
dushaoshuai opened this issue Jun 26, 2021 · 1 comment
Open

A trivial mistake in the code comment #399

dushaoshuai opened this issue Jun 26, 2021 · 1 comment

Comments

@dushaoshuai
Copy link

cron/cron.go

Line 193 in ccba498

// Entry returns a snapshot of the given entry, or nil if it couldn't be found.

func (c *Cron) Entry(id EntryID) Entry {
	for _, entry := range c.Entries() {
		if id == entry.ID {
			return entry
		}
	}
	return Entry{}
}

The zero value for a struct is not nil.

@robfig
Copy link
Owner

robfig commented Oct 1, 2021

I agree.. I would merge a PR fixing it. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants