Skip to content

Build error on override/merge.go line 129 #519

@lionello

Description

@lionello

slices.SortFunc(seq, func(a, b any) bool {

Latest version of golang/x/exp changes type of SortFunc: it now returns an int. See https://cs.opensource.google/go/x/exp/+/302865e7556b4ae5de27248ce625d443ef4ad3ed:slices/sort.go;dlc=d98519c114953aa372c373aa4c7122a39d7932af

When golang.org/x/exp is too new, you get this build error:

../../../go/pkg/mod/github.com/compose-spec/compose-go/v2@v2.0.0-beta.2/override/merge.go:129:24: type func(a any, b any) bool of func(a, b any) bool {…} does not match inferred type func(a any, b any) int for func(a E, b E) int

I fixed it by downgrading the exp package:

go get golang.org/x/exp@613f0c0eb8a1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions