Sunday, October 13, 2024
HomeGolangimport an area module *with out* re-downloading the imported module's dependencies? -...

import an area 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

exchange 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 (sorts, features, and so forth).
Right here’s its go.mod:

module module_to_import

go 1.21.6

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

require (
        ...
)

Now, that is sample_project’s foremost.go:

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

The issue is that when doing go run foremost.go, it’s going to try and 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 include bundle github.com/ethereum/go-ethereum/arbitrum_types

I wish 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