BurntSushi / go-sumtype

A simple utility for running exhaustiveness checks on Go "sum types."
The Unlicense
420 stars 22 forks source link

internal error: package "encoding/json" without types was imported from "local package" #17

Closed alarbada closed 1 year ago

alarbada commented 2 years ago

I'm not sure why I'm getting this error. I'm on go 1.18.

The same happens actually when using other packages:

internal error: package "fmt" without types was imported from "command-line-arguments"

BurntSushi commented 2 years ago

Well if it's happening using other packages too then it seems like it's not an issue with this package and probably an environment or configuration issue on your end...

alarbada commented 2 years ago

Wow really quick response! It is indeed not an issue of this package, I found out on this comment:

https://github.com/golang/go/issues/37617#issuecomment-619184447

Apparently go-sumtype "golang.org/x/tools/go/packages" version is outdated, updating it solves the issue.