Is it possible to have two constants with the same name in different files?
foo.go
const {
deviceId = 1 // I dont need this outside the file scope
}
type DeviceA struct {
.. some fields..
// I cannot make constant fields here
}
.. some methods ...
bar.go
const {
deviceId = 2 // I dont need this outside the file scope
}
type DeviceB struct {
.. some fields ..
// I cannot make constant fields here
}
.. some methods ...
If I do this, I get that deviceId
has been redeclared. How can I keep these constants in the scope of the file?
I would not mind using some kind of namespace for the constants if that were a solution to this.