I'm very new with GO and don't understand some basics - so I'm really don't know how to ask ask google about it. So I have a project with 2 files, both in package main - the root of src. One file is main.go
package main
var (
node * NodeDTO
)
func main() {
node = &NodeDTO{ID: 1}
}
And another is dto.go with
package main
type NodeDTO struct {
ID int
}
So main.go tells me - "undefined: NodeDTO". But if I create a dir dto near of main.go and use my NodeDTO from there like
package main
import "another_tcp_server/dto"
var (
node * dto.NodeDTO
)
func main() {
node = &dto.NodeDTO{ID: 1}
}
It's ok. Please tell me why this happen?