Run a small program:
package main import "fmt" const true = false func main() { if (true == false) { fmt.Println("True equals to false") } fmt.Println("Hello World") }
https://play.golang.org/p/KwePsmQ_q9
- What did you expect to see?
An error or warning message stating that I am creating a constant with an already defined name and potentially violating the entire application.
- What did you see instead?
Work without problems. There are no warnings or anything to prevent the creation of a new constant with an already defined name.
source share