I have this line: fmt.Printlin("the dao:", dao);
and it logs: the dao: &{<nil> <nil>} the overall method looks like: func (dao *UserAttributeDao) GetDecryptedUserAttributes(workflowID string) (*PayoutUserAttributeRecord, error) { getItemInput := &dynamodb.GetItemInput{ TableName: aws.String(payoutUserAttributesTableName), ConsistentRead: aws.Bool(true), Key: map[string]*dynamodb.AttributeValue{ payoutUserAttributesPK: {S: aws.String(workflowID)}, }, } fmt.Println("the dao:", dao) record, err := dao.GetItem(getItemInput) // NIL POINTER REF HERE if err != nil { logrus.WithError(err).Errorf("error during GetItem from DynamoDB table %v for id: %v", payoutUserAttributesTableName, workflowID) return nil, err } does anyone know why calling the method would result in a nil pointer? To me it seems like the object for which the method is being called is nil, but that doesn't make that much sense to me. My main method looks like: func main() { log.Println("doing some printing") var d = new(lib.UserAttributeDao) x, err := d.GetDecryptedUserAttributes(""); // THIS RESULTS IN NIL POINTER if err != nil { log.Fatal(err) } } .... -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/b1f9de70-fbe6-42ad-8cf5-7fb65d0908fcn%40googlegroups.com.