Skip to content

Commit

Permalink
Raise exception when go_package contains @
Browse files Browse the repository at this point in the history
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
  • Loading branch information
TG1999 committed Mar 7, 2024
1 parent d153458 commit 1daab5a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/packageurl/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ def get_golang_purl(go_package: str):
# package version
# github.com/gorilla/mux v1.8.1
# https://github.com/moby/moby/blob/6c10086976d07d4746e03dcfd188972a2f07e1c9/vendor.mod#L51
if "@" in go_package:
raise Exception(f"{go_package} should not contain ``@``")
if " " in go_package:
go_package, _, version = go_package.rpartition(" ")
parts = go_package.split("/")
Expand Down

0 comments on commit 1daab5a

Please sign in to comment.