tidwall / geojson

GeoJSON for Go. Used by Tile38
MIT License
130 stars 28 forks source link

Errors when importing the 'tidwall/geojson' package #20

Closed danilvpetrov closed 1 year ago

danilvpetrov commented 2 years ago

When running go get -u github.com/tidwall/geojson@latest I receive the following error:

    github.com/tidwall/lotsa@v1.0.2: reading github.com/tidwall/lotsa/go.mod at revision v1.0.2: git ls-remote -q origin in /Users/user/go/pkg/mod/cache/vcs/d11311936b4f8995a8390df6960b70488ff2ad2b6842ea20a38c94116dd7efe0: exit status 128:
    fatal: 'origin' does not appear to be a git repository
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.

By the look of it, the repository github.com/tidwall/lotsa needs to be converted to a Golang module.

danilvpetrov commented 2 years ago

Appologies @tidwall, is it just me getting this error when trying to go get github.com/tidwall/geojson@latest? I cleared my go module cache couple of times, but the error still persists.

tidwall commented 2 years ago

I'm not seeing the same issue as you.

Here's what happens when I create a Go project and import geojson:

~ $ mkdir get-geojson
~ $ cd get-geojson
get-geojson $ go mod init example
go: creating new go.mod: module example
get-geojson $ go get -u github.com/tidwall/geojson@latest
go: added github.com/tidwall/geoindex v1.6.2
go: added github.com/tidwall/geojson v1.3.5
go: added github.com/tidwall/gjson v1.14.3
go: added github.com/tidwall/match v1.1.1
go: added github.com/tidwall/pretty v1.2.0
go: added github.com/tidwall/rtree v1.7.1
go: added github.com/tidwall/sjson v1.2.5
get-geojson $ cat go.mod
module example

go 1.19

require (
    github.com/tidwall/geoindex v1.6.2 // indirect
    github.com/tidwall/geojson v1.3.5 // indirect
    github.com/tidwall/gjson v1.14.3 // indirect
    github.com/tidwall/match v1.1.1 // indirect
    github.com/tidwall/pretty v1.2.0 // indirect
    github.com/tidwall/rtree v1.7.1 // indirect
    github.com/tidwall/sjson v1.2.5 // indirect
)
get-geojson $

What version of Go are currently using?

danilvpetrov commented 2 years ago

Thanks for your reply, @tidwall!

I am running 1.19.1 at the moment and I cleaned my Go module cache with go clean -cache and go clean -modcache before I started seeing this problem. Before that I was able to import github.com/tidwall/geojson without any problem.

danilvpetrov commented 1 year ago

Closing the issue: the problem disappeared after the entire GOPATH directory was wiped and reinstated.