This question already has an answer here:
- Golang Import (undefined: Request) 1 answer
- Imported struct from other package is undefined 1 answer
- How to access a struct from an external package in Go 1 answer
- Package imports, cannot use struct from imported package 1 answer
- Why am I unable to use a struct defined in a different package? 3 answers
Newbie here.
I have a struct like this
import (
"context"
"time"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
)
type DatabaseServiceImpl struct {
client *Client
collection *Collection
}
But it complaints that it cannot find Client nor Collection.
I am definitely missing something about Go. Could someone please point out.
And here is where the Collection is defined https://github.com/mongodb/mongo-go-driver/blob/master/mongo/collection.go
</div>