Skip to content

Fix bug in tt.Seconds Scan#533

Merged
irees merged 1 commit intomainfrom
fix-seconds-scan
Dec 5, 2025
Merged

Fix bug in tt.Seconds Scan#533
irees merged 1 commit intomainfrom
fix-seconds-scan

Conversation

@irees
Copy link
Copy Markdown
Contributor

@irees irees commented Dec 5, 2025

No description provided.

Copilot AI review requested due to automatic review settings December 5, 2025 10:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug in the tt.Seconds type's Scan method and corrects the time window presence check in StopTime validation. The primary issue was that empty strings were being incorrectly parsed as midnight (00:00:00) instead of being treated as "not provided". Additionally, the time window validation logic incorrectly required values greater than zero, which would have excluded valid midnight times.

Key Changes:

  • Added early return for empty strings in Seconds.Scan to properly handle unprovided time fields
  • Simplified hasTimeWindow logic to check only the Valid flag, allowing zero values (midnight) to be correctly recognized as valid time windows

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tt/seconds.go Adds empty string check in Scan method to return early with Valid=false, preventing empty strings from being parsed as midnight
gtfs/stop_time.go Removes Val > 0 condition from hasTimeWindow check to correctly identify time windows that include midnight (value 0)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@irees irees merged commit 2e92517 into main Dec 5, 2025
14 checks passed
@irees irees deleted the fix-seconds-scan branch December 5, 2025 11:03
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.

2 participants