Variable fqfn conflicts with imported package
In vkrouter
- import: https://github.com/suborbital/atmo/blob/main/atmo/appsource/vkrouter.go#L11
- variable: https://github.com/suborbital/atmo/blob/main/atmo/appsource/vkrouter.go#L73
This should not happen. Gets confusing, and go's shadow rules will make it hard to understand which one is being used.
@javorszky Can you explain what should be done here? I want to take this issue
Should I remove the import package?
Hey @bishal7679 ! Thanks for your interest in this.
The ask is to rename the variable fqfn to something else, because in this particular case the issue is:
package appsource
import (
"github.com/suborbital/atmo/fqfn"
)
func something() {
fqfn := fqfn.FromParts(ident, namespace, fn, version)
// ...
}
In the variable declaration (fqfn :=), it's essentially redeclaring what fqfn is. Previously it was how you referenced the package. After that line the package is unreachable because fqfn now means the variable.
The easiest solution is to find a different name for the variable, like runnableFQFN or something similar to differentiate between the local variable, and the package.
Let me know if you'd like more context around it 🙂
@javorszky Thanks! I will make a PR for this issue
@javorszky Please review this PR