3
3
3Create2021-05-08 21:50:57
go
3Create, 2021-05-08 21:50:57

Error: package ....... is not in GOROOT. How to decide?

I decided to try examples from github.
Initially, the library was imported from github.
Sort of like this:

import (
  "context"
  "errors"
  "strconv"
  "strings"

  "github.com/adshao/go-binance"
)

Download this archive. Moved to a folder. Changed the import.
import (
  "context"
  "errors"
  "strconv"
  "strings"

  "NeuroBot/binance/binance_2.2"
)

Jetbrains Go did not give any errors.
I run go build.
And got an error:
binance\exchange.go:4:2: package NeuroBot/binance/binance_2.2 is not in GOROOT (C:\Users\Groo\go\go1.16.3\src\NeuroBot\binance\binance_2.2)

Tell me please)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evgeny Mamonov, 2021-05-08
@3Create

It is better to install the package as written in its instructions.
Execute on the command line
go get github.com/adshao/go-binance/v2
Well, then import like this

import (
    "github.com/adshao/go-binance/v2"
)

V
vgrabkowot, 2021-05-09
@vgrabkowot

you can use g.mod replace

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question