Skip to content
This repository has been archived by the owner on Jan 16, 2021. It is now read-only.

Allow username in package name #586

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion gosrc/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@ func IsValidRemotePath(importPath string) bool {
return false
}

if !validHost.MatchString(parts[0]) {
// use only the hostname, if there is a username in the package name
hostparts := strings.Split(parts[0], "@")
host := hostparts[0]
if len(hostparts) > 1 {
host = hostparts[1]
}

if !validHost.MatchString(host) {
return false
}

Expand Down