Though Go's linter didn't give me a hint that I was using mismatched type;
0.71.0
Yes
I tried to compile this code:
api := self.client.API()
username := fmt.Sprintf("@%v", group)
peer, err := api.ContactsResolveUsername(
ctx,
username,
)
if err != nil {
return err
}
history, err := api.MessagesGetHistory(
ctx,
&tgappapiextra.MessagesGetHistoryRequest{
Peer: peer,
Limit: 20,
},
)
if err != nil {
return err
}
messages := history.String()
fmt.Printf(
"retrieved msgs => %v\n",
messages,
)
I expect successful compilation;
An error of type mismatch:
services/my-secret-thing/index.go:60:11: cannot use peer (variable of type *tg.ContactsResolvedPeer) as type tg.InputPeerClass in struct literal:
*tg.ContactsResolvedPeer does not implement tg.InputPeerClass (missing construct method)
Go version: go1.18.8 linux/amd64
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too