fix: add missing throws parameter to golang validator [closes #87] - #88
Open
jdalton wants to merge 1 commit into
Open
fix: add missing throws parameter to golang validator [closes #87]#88jdalton wants to merge 1 commit into
jdalton wants to merge 1 commit into
Conversation
jdalton
force-pushed
the
jdalton/fix-87
branch
from
October 4, 2025 17:27
8cb3de4 to
786ffda
Compare
jdalton
force-pushed
the
jdalton/fix-87
branch
from
November 1, 2025 17:21
1c75a1e to
786ffda
Compare
mcombuechen
approved these changes
Nov 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Parsing certain Go package URLs crashes instead of validating them. The
golangvalidator refers to a variable namedthrowsthat was never declared in its signature, so as soon as that branch is reached Node raisesReferenceError: throws is not defined— a hard crash from inside a library whose whole job is to parse untrusted strings safely.Adding the missing
throwsparameter, which every other type validator already takes, restores the intended behavior: an invalid version is reported the normal way instead of taking the caller down with it.Closes #87.
What the tests pin — the crash case, plus the three shapes that must keep parsing
A new
golangdescribe block covers both directions, so the fix cannot regress into over-rejecting:v1.0.invalidv1.0.0v0.0.0-20210922020428-25de7278fc84(pseudo-version)vprefix