goland doesn't understand nil type

got an odd issue, for one of my projects goland inspector complains about nil for simple things such as

 

client, err := bigquery.NewClient(ctx, "project-name")

if err != nil {
    return nil, err
}

 

 

on err != nil it complains "Invalid operation: err!= nil (mismatched types error and Type) it's as if it doesn't know what built in nil type is.

same code in another project, no issue, not sure if I some how flipped some setting or what, tried to recreate repo and workspace same issue.  can build and run project without issues.

 

 

0
4 comments

What's the message that the IDE displays when you place your cursor on the `error` part of the return values in the function signature?

It looks suspicious that it's highlighted with yellow.

0
Avatar
Permanently deleted user

it's error from builtin.  It had something to do with some setting for this workspace.  I found all directories that GoLand uses under ~/Libraries wiped them out and everything is back to normal.  Not something from the project itself...

even simple error "example" such as one below had the same issue

package main

import (
"errors"
"fmt"
)

func main() {
err := errors.New("emit macho dwarf: elf header corrupted")
if err != nil {
fmt.Print(err)
}
}

Thanks!

0

Well, if you wiped everything there's nothing we can do now since it's likely we can't recover any logs from the IDE. So does this work now or not?

0
Avatar
Permanently deleted user

I should've made a copy instead of deleting.  Yes it is working fine now.

 

Thank you!

0

Please sign in to leave a comment.