Import dgo/v200 or dgo/v2 package not found

,

How do we use v200 in import path? since it is not able to find that package at all?

And i get an error like this:-

Has anyone been able to use v200 of dgo client? Can you provide an example?

It should work per the README Section above.

An example is in the dgo repo: dgo/examples_test.go at master · dgraph-io/dgo · GitHub

The example says something like this:-

Now if we are importing “github.com/dgraph-io/dgo/v200”, how can we access functions and types in package dgo? The only way i see that it could be possible is if we have the package dgo, in that path “github.com/dgraph-io/dgo/v200”, which basically means we have to create the folder v200? What am i missing here really?

The v200 is not a folder but Semantic Versioning scheme. research!rsc: Semantic Import Versioning (Go & Versioning, Part 3)
Publishing Go Modules - The Go Blog

The latest dgo module is called dgo/v200

@onkarbanerjee can you show your go.mod file?

The following should work

import github.com/dgraph-io/dgo/v200

func main() { dgo.SomeFunction }

See how we use dgo/v200 in dgraph

2 Likes

If you’re not using go modules, you should be able to import it as:

	"github.com/dgraph-io/dgo"
	"github.com/dgraph-io/dgo/protos/api"

and it will import the latest version.

2 Likes

@onkarbanerjee: I’m having the same problems as you. Have you been able to solve the issue?

@ylockson Does this help?

go mod init your-mod-name
go get
4 Likes