Skip to content

Functions depending on other Functions #128

@Deleplace

Description

@Deleplace
package main

import (
	"fmt"
)

func main() {
	a := myFloats{1.0, 2.0, 3.0}
	fmt.Println(a.First())
}

//go:generate pie myFloats.First
type myFloats []float64

yields

./myfloats_pie.go:5:11: ss.FirstOr undefined (type myFloats has no field or method FirstOr)

Currently, the developer hits this error and figures out they must explicitly ask for FirstOr:

//go:generate pie myFloats.First.FirstOr

It would be nice if Pie somehow knew it requires to generate FirstOras a dependency for First. I'm not saying this is trivial though, and also the inconvenience is minor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions