I have this package structure in my go module, and I am adding commands using cobra-cli:
.
├── LICENSE
├── cmd
│ ├── constants.go
│ ├── root.go
│ └── tools
│ └── tools.go
├── go.mod
├── go.sum
└── main.go
In tools.go
, I want to import constants.go
which I want to define for globally used constants across all files in my module, and is simple go file:
package cmd
const (
FOO = "https://a.b.c"
BAR = "https://p.q.r"
)
How do I import this? Also is there a better way of doing this?