@jonghi

Как создать зависимости на Go?

Я начинающий, помогите разобраться, не могу создать зависимости, ссылки на гитхаб вроде корректные

import (
	"context"
	"crypto/ecdsa"
	"fmt"
	"log"
	"math/big"

	"github.com/ethereum/go-ethereum/common"
	"github.com/ethereum/go-ethereum/crypto"
	"github.com/ethereum/go-ethereum/ethclient"
	"github.com/ethereum/go-ethereum/params"
	"github.com/ethereum/go-ethereum/signer/core/types"
	"github.com/ethereum/go-ethereum/txpool"
)


при go run main.go, получаю:
C:\Users\Jonghi\Desktop\my-script-go>go run main.go
main.go:10:2: no required module provides package github.com/ethereum/go-ethereum/common: go.mod file not found in current directory or any parent directory; see 'go help modules'
main.go:11:2: no required module provides package github.com/ethereum/go-ethereum/crypto: go.mod file not found in current directory or any parent directory; see 'go help modules'
main.go:12:2: no required module provides package github.com/ethereum/go-ethereum/ethclient: go.mod file not found in current directory or any parent directory; see 'go help modules'
main.go:13:2: no required module provides package github.com/ethereum/go-ethereum/params: go.mod file not found in current directory or any parent directory; see 'go help modules'
main.go:14:2: no required module provides package github.com/ethereum/go-ethereum/signer/core/types: go.mod file not found in current directory or any parent directory; see 'go help modules'
main.go:15:2: no required module provides package github.com/ethereum/go-ethereum/txpool: go.mod file not found in current directory or any parent directory; see 'go help modules'
  • Вопрос задан
  • 111 просмотров
Пригласить эксперта
Ответы на вопрос 1
@historydev
Острая аллергия на анимешников
go mod init example
go get my_git_url_without_https://
go mod tidy
go run .
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы
18 апр. 2024, в 21:56
2000 руб./за проект
18 апр. 2024, в 21:00
150 руб./за проект