How to set go version?

I am getting an error that the go code does not compile when using “embed”, a feature of go 1.16. I believe this is due to deepsource not using the appropriate go version. We have go 1.16 defined in go.mod and I don’t see any other configuration values to set for the go version of deepsource.

I would attach a screenshot but this forum forbids it.

We were using go 1.15 to run analysis, hence the error message. We have upgraded it to using go 1.16 now, which fixes this issue.

Thanks, that certainly fixes our issue for the moment. Is there any intention on using the go version specified by the user?

1 Like

@prestonvanloon Currently, we are not planning to do it. We have recently upgraded to Go 1.16 and we would continue to stay updated with the latest version of Go.

Ref: Go 1 compatibility promise

It is intended that programs written to the Go 1 specification will continue to compile and run correctly, unchanged, over the lifetime of that specification.

As we have shifted to Go 1.16, we’d be supporting new features, fixes, etc. that were introduced in v1.16 and we expect all Go programs to compile and run correctly as they used to with older versions of Go. And hence, we are not planning for user defined version selection for Go.