Skip to content

Fix deprecated rand.Seed and Crontab.Save pointer receiver bug#42

Merged
aflanagan merged 2 commits intomasterfrom
claude/prioritize-open-issues-AwBXl
Feb 5, 2026
Merged

Fix deprecated rand.Seed and Crontab.Save pointer receiver bug#42
aflanagan merged 2 commits intomasterfrom
claude/prioritize-open-issues-AwBXl

Conversation

@aflanagan
Copy link
Contributor

  • Remove deprecated rand.Seed() call in lib/utils.go (fix deprecated use of rand.Seed #21). Since Go 1.20+ the global rand is automatically seeded, and the per-call re-seeding was actually causing identical values within the same second.

  • Change Crontab.Save from value receiver to pointer receiver so that setting c.IsSaved = true actually persists on the caller's struct (crontab.Save does not update crontab field #22).

  • Add tests for both fixes.

- Remove deprecated rand.Seed() call in lib/utils.go (#21). Since Go
  1.20+ the global rand is automatically seeded, and the per-call
  re-seeding was actually causing identical values within the same
  second.

- Change Crontab.Save from value receiver to pointer receiver so that
  setting c.IsSaved = true actually persists on the caller's struct
  (#22).

- Add tests for both fixes.

https://claude.ai/code/session_01CukrzEXPeaab9By46BLrG3
@aflanagan aflanagan force-pushed the claude/prioritize-open-issues-AwBXl branch 7 times, most recently from d70a846 to 0514241 Compare February 5, 2026 01:53
@shaneharter
Copy link
Collaborator

i don't see IsSaved being read anywhere, we can just remove it.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@aflanagan aflanagan merged commit c18aa2a into master Feb 5, 2026
1 of 2 checks passed
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

Successfully merging this pull request may close these issues.

3 participants