I have a module sample_project
, which has a go.mod
like this:
module sample_project
go 1.21.6
replace local.mod/module_to_import => ../module_to_import
require (
github.com/ethereum/go-ethereum v1.13.11
...
)
But module_to_import
has a replacement for github.com/ethereum/go-ethereum
because it uses the arbitrum version of ethereum-go, which has some arbitrum-related stuff (types, functions, etc).
Here’s its go.mod
:
module module_to_import
go 1.21.6
replace github.com/ethereum/go-ethereum => ./go-ethereum
require (
...
)
Now, this is sample_project’s main.go
:
import (
...
imported_utils "local.mod/module_to_import/utils"
)
The problem is that when doing go run main.go
, it will attempt to download all the packages required by module_to_import
and I get an error like this:
module github.com/ethereum/go-ethereum@latest found (v1.13.11), but does not contain package github.com/ethereum/go-ethereum/arbitrum_types
I want to use the local package which resides in ../module_to_import/go-ethereum
. How can I do it?