Velocidex/go-ese

Fix module name in go.mod

Closed this issue · 7 comments

go-ese declare its path as www.velocidex.com/golang/go-ese plase update it to match the current path as github.com/Velocidex/go-ese

That is the correct mod path.

Indeed you are importing it as github.com/Velocidex/go-ese but that is not the module import path - you need to import it as www.velocidex.com/golang/go-ese:

import "www.velocidex.com/golang/go-ese/parser"

See here for an example https://github.com/Velocidex/velociraptor/blob/63f122ec157a1372eafecfd8d90f2b5c86c80a84/vql/parsers/ese/ese.go#L27

That implies that i have to go get www.velocidex.com/golang/go-ese but since this project is hosted on github that makes no sense to me

In Go, where a package is hosted has nothing to do with the import path.

https://pkg.go.dev/cmd/go#hdr-Remote_import_paths

The docs specify that certain sites like github use specific import path:

GitHub (Git)

import "github.com/user/project"
import "github.com/user/project/sub/directory"

Yes that is how you can reference code on Github but you dont have to - the docs go on to explain

If the import path is not a known code hosting site and also lacks a version control qualifier, the go tool attempts to fetch the import over https/http and looks for a <meta> tag in the document's HTML <head>.

The meta tag has the form:

<meta name="go-import" content="import-prefix vcs repo-root">
The import-prefix is the import path corresponding to the repository root. It must be a prefix or an exact match of the package being fetched with "go get". If it's not an exact match, another http request is made at the prefix to verify the <meta> tags match.

The advantage of this is that it is easy to switch to another hosting site (e.g. Gitlab, bitbucket etc) without having to change all the callsites so that is why we do it for all our packages.