R
R
Roman Kharchenko2019-08-01 05:03:50
go
Roman Kharchenko, 2019-08-01 05:03:50

How to import an internal package?

There is a package: https://godoc.org/golang.org/x/tools/internal/semver
I want to use it.

import (
  "encoding/json"
  "fmt"
  "golang.org/x/tools/internal/semver"
)
...

Naturally I get:
***\app.go:6:2: use of internal package golang.org/x/tools/internal/semver not allowed

GOPATH is globally defined as C:\Users\NameUser\go
5d4247f63f2b4381808187.png
Everything is in place. But what kind of hedgehog is not connected?
PS
import (
  "encoding/json"
  "fmt"
  "golang.org/x/tools"
)
...

When I do this, I can't figure out how to use semver.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Kharchenko, 2019-08-01
@Sarymian

It's hard to learn Go... not all things seem obvious...
In general, there is magic: https://godoc.org/-/subrepo
NAKUYA?!?! I do not know. Why create 2 repositories, I xs ?! But that's how it works. Many other things in Go seem strange to me - more precisely, their implementation.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question