1

I am already familiar with C and I've been working on improving my Golang skills. Anyone know how to create something reminiscent of a void * in Golang?

For example:

struct Node {
    void *data;
    struct Node *next;
    struct Node *prev;
}
bmacrevolution
  • 553
  • 2
  • 6
  • 14

1 Answers1

0

You have to use an empty interface, (interface {}), and modify it to what you want. (Source). This is known as an empty interface, and it can embody any type.

Community
  • 1
  • 1
Arnav Borborah
  • 11,357
  • 8
  • 43
  • 88