Parsing go.mod: unexpected module path "howett.net/plist"

Viewed 283

I'd like to import a Go module which has the following in its go.mod:

> grep plist go.mod
    github.com/DHowett/go-plist v0.0.0-20180609054337-500bd5b9081b
    howett.net/plist v0.0.0-20181124034731-591f970eefbb // indirect

However, if I try to go get that package I get the following error message:

go: github.com/DHowett/go-plist@v0.0.0-20181124034731-591f970eefbb: parsing go.mod: unexpected module path "howett.net/plist"
go get: error loading module requirements

I also get this error if I just try to go get github.com/DHowett/go-plist:

> go get github.com/DHowett/go-plist
go: finding github.com/DHowett/go-plist latest
go: github.com/DHowett/go-plist@v0.0.0-20181124034731-591f970eefbb: parsing go.mod: unexpected module path "howett.net/plist"
go: error loading module requirements

How can I fix this error so that I can import that module?

2 Answers

This module has its identity in go.mod defined as howett.net/plist instead of github.com/DHowett/go-plist.

If you run this, it should work fine:

go get howett.net/plist

See also this entry in the official Golang Wiki

I ended up fixing this by replacing

import "github.com/DHowett/go-plist

everywhere in the module that I wanted to import by

import "howett.net/plist

and running go mod tidy. After that, I was able to import it without errors.

Related