Задать вопрос
@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'
  • Вопрос задан
  • 125 просмотров
Подписаться 1 Средний 2 комментария
Помогут разобраться в теме Все курсы
  • Нетология
    Go-разработчик с нуля + нейросети
    9 месяцев
    Далее
  • Академия Эдюсон
    GO-разработчик
    4 месяца
    Далее
  • Яндекс Практикум
    Продвинутый Go-разработчик
    6 месяцев
    Далее
Пригласить эксперта
Ответы на вопрос 1
@VadimFilimonov
В корне проекте запустите команды:

go mod init my-app
go mod tidy
Ответ написан
Комментировать
Ваш ответ на вопрос

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

Похожие вопросы
ITK academy Краснодар
от 75 000 до 120 000 ₽
Polydev Москва
от 150 000 до 250 000 ₽
Уфанет Уфа
от 140 000 до 203 000 ₽