English 中文(简体)
在试图把“替代”点变成“ListaDeTareas”在戈马的点时,我怎么能够确定“无效的补习”错误?
原标题:How can I fix the `invalid recursive type Tarea` error when trying to make `subtareas` a pointer to `ListaDeTareas` in Go?
  • 时间:2023-06-03 21:19:05
  •  标签:
  • go

我需要在塔雷亚角做小站,成为名单阿·德塔纳斯的协调人,但不是工作。 页: 1

type Tarea struct {
    nombre    string
    duracion  float32

    subtareas *ListaDeTareas
}

type ListaDeTareas[T Tarea] struct {
    elementos listadetareas.LinkedList[Tarea]
}
问题回答

看来,在<代码>ListaDeTareas中,你没有使用类型的参数。 删除后将解决这一问题。

type Tarea struct {
    nombre    string
    duracion  float32

    subtareas *ListaDeTareas
}

type ListaDeTareas struct {
    elementos listadetareas.LinkedList[Tarea]
}




相关问题
minimum work size of a goroutine [closed]

Does anyone know approximately what the minimum work size is needed in order for a goroutine to be beneficial (assuming that there are free cores for the work to be offloaded to)?

How do you get the terminal size in Go?

How do I get the terminal size in Go. In C it would look like this: struct ttysize ts; ioctl(0, TIOCGWINSZ, &ts); But how to i access TIOCGWINSZ in Go

What do you use to write Go [closed]

I know its a bit too early, but I ve been trying out Go (Google s Programming Language) and its kindof annoying to write code in gedit. So, my question: What do you use to experiment with Go?

Shared memory vs. Go channel communication

One of Go s slogans is Do not communicate by sharing memory; instead, share memory by communicating. I am wondering whether Go allows two different Go-compiled binaries running on the same machine to ...

Embedding instead of inheritance in Go

What is your opinion of this design decision? What advantages does it have and what disadvantages? Links: Embedding description