predeclared identifier any showing syntax error [solved]

已完成

Hello, I recently installed the latest beta version of Golang to work with generics. It also introduced the new identifier "any" which acts as an interface. However, Goland shows me errors everywhere it is used. 

file, err := os.Create("test.txt")
if err != nil {
panic(err)
}
_ = file

"Cannot use err (type error) as the type any"
I believe this might describe the same issue: https://youtrack.jetbrains.com/issue/GO-12179

are there any workarounds for this bug? Code compiles and runs fine

0
正式评论

Hello,

As a workaround, you can download GoLand Nightly via Toolbox App and it contains the fix.

Hello,

Thank you for your rapid response. That did indeed solve the issue. 

0

请先登录再写评论。