Sunday, May 19, 2024
HomeGolangHow you can import a neighborhood module *with out* re-downloading the imported...

How you can import a neighborhood module *with out* re-downloading the imported module’s dependencies? – Getting Assist


I’ve a module sample_project, which has a go.mod like this:

module sample_project

go 1.21.6

change native.mod/module_to_import => ../module_to_import

require (
	github.com/ethereum/go-ethereum v1.13.11
        ...
)

However module_to_import has a substitute for github.com/ethereum/go-ethereum as a result of it makes use of the arbitrum model of ethereum-go, which has some arbitrum-related stuff (varieties, capabilities, and so forth).
Right here’s its go.mod:

module module_to_import

go 1.21.6

change github.com/ethereum/go-ethereum => ./go-ethereum

require (
        ...
)

Now, that is sample_project’s primary.go:

import (
	...
	imported_utils "native.mod/module_to_import/utils"
)

The issue is that when doing go run primary.go, it would try to obtain all of the packages required by module_to_import and I get an error like this:

module github.com/ethereum/go-ethereum@newest discovered (v1.13.11), however doesn’t comprise bundle github.com/ethereum/go-ethereum/arbitrum_types

I need to use the native bundle which resides in ../module_to_import/go-ethereum. How can I do it?

I suppose (however am not sure) that including your personal go-ethereum substitute will do the trick. Have tyou tried that?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments