Skip to content

Commit

Permalink
refactor: inline remote and remove unused variable
Browse files Browse the repository at this point in the history
  • Loading branch information
xlgmokha committed Aug 31, 2021
1 parent dea76f5 commit bbb12a3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions go_modules/helpers/importresolver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,16 @@ type Args struct {
}

func VCSRemoteForImport(args *Args) (interface{}, error) {
remote := args.Import
scheme := strings.Split(remote, ":")[0]

local, err := ioutil.TempDir("", "unused-vcs-local-dir")
if err != nil {
return nil, err
}

return resolveDestinationUrlFrom(remote, local)
return resolveDestinationUrlFrom(args.Import, local)
}

func resolveDestinationUrlFrom(remote string, local string) (interface{}, error) {
scheme := strings.Split(remote, ":")[0]
switch scheme {
case "http", "https":
repo, err := vcs.NewRepo(remote, local)
Expand Down

0 comments on commit bbb12a3

Please sign in to comment.