Cannot find module providing package github.io/xxx

Trying to learn gRPC in GO from here, so I the code git uploaded enter link description here, which is containing 3 folders:

  • server
  • client
  • hellopb (which is the go code generated from the porto3 code

In both, server.go and client.go I have the below:

package main

import (
	"context"
	"fmt"
	"log"

	"github.io/hajsf/grpc/hellopb"
	"google.golang.org/grpc"
)

But once I’m running go mod tidy I’m getting the below error:

PS D:\Documents\grpc\client> go mod tidy
go: finding module for package github.io/hajsf/grpc/hellopb
github.io/hajsf/grpc/client imports
        github.io/hajsf/grpc/hellopb: cannot find module providing package github.io/hajsf/grpc/hellopb: unrecognized import path "github.io/hajsf/grpc/hellopb": parse https://github.io/hajsf/grpc/hellopb?go-get=1: no go-import meta tags ()

What could be the issue here, and how to fix it?

Sorry it is my mistake, I used github.io while I should use gethub.com, so I fixed the module names and path, cleaned the module imports using:

go clean -modcache

Then reimporting required modules using:

go mod tidy
1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.