Skip to content

go - WIT tuple type generated code uses unkeyed fields #1582

@asteurer

Description

@asteurer

When the go vet -unsafeptr=false ./... command is run against the generated bindings, we get the following warning:

go.bytecodealliance.org/pkg/wit/types.Tuple2[string, string] struct literal uses unkeyed fields

This can be solved by changing a generated tuple from this:

result = append(result, witTypes.Tuple2[string, string]{value1, value2})

To this:

result = append(result, witTypes.Tuple2[string, string]{F0: value1, F1: value2})

Metadata

Metadata

Assignees

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