
Security News
Open Source Maintainers Demand Ability to Block Copilot-Generated Issues and PRs
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
github.com/deepin-community/golang-github-jmhodges-clock
Package clock provides an abstraction for system time that enables testing of time-sensitive code.
Where you'd use time.Now, instead use clk.Now where clk is an instance of Clock.
When running your code in production, pass it a Clock given by Default() and when you're running it in your tests, pass it an instance of Clock from NewFake().
When you do that, you can use FakeClock's Add and Set methods to control how time behaves in your code making them more reliable while also expanding the space of problems you can test.
This code intentionally does not attempt to provide an abstraction over time.Ticker and time.Timer because Go does not have the runtime or API hooks available to do reliably. See https://github.com/golang/go/issues/8869
Be sure to test Time equality with time.Time#Equal, not ==.
For documentation, see the godoc.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
Research
Security News
Malicious Koishi plugin silently exfiltrates messages with hex strings to a hardcoded QQ account, exposing secrets in chatbots across platforms.
Research
Security News
Malicious PyPI checkers validate stolen emails against TikTok and Instagram APIs, enabling targeted account attacks and dark web credential sales.