Closed yume-red closed 3 years ago
package main import ( "fmt" "github.com/gabstv/go-monero/walletrpc" ) /* type Payment struct { PaymentID string TxHash string Amount uint64 BlockHeight uint64 UnlockTime uint64 } */ func main() { client := walletrpc.New(walletrpc.Config{ Address: "http://127.0.0.1:18085/json_rpc",}) var check []walletrpc.Payment check, _ = client.GetPayments("0000000000000000") fmt.Println(check.Amount) }
Error message: ./main.go:18:19: check.Amount undefined (type []walletrpc.Payment has no field or method Amount)
./main.go:18:19: check.Amount undefined (type []walletrpc.Payment has no field or method Amount)
Link to the Payment type: https://pkg.go.dev/github.com/gabstv/go-monero/walletrpc#Payment I have tried to grab the other variables in this type with the same issue.
Sorry didn't realise it was a list. fmt.Println(check[0].Amount) works
fmt.Println(check[0].Amount)
The following program doens't work
Error message:
./main.go:18:19: check.Amount undefined (type []walletrpc.Payment has no field or method Amount)
Link to the Payment type: https://pkg.go.dev/github.com/gabstv/go-monero/walletrpc#Payment I have tried to grab the other variables in this type with the same issue.